LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-29-2005, 07:46 AM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
vim invoke


Everytime I write a perl script I have to type "/usr/bin/perl -w" and "use strict".

Is there any way to automate this process so that everytime I invoke a perl script, say "vim test.pl" it will see the extension (pl) and will add those lines automatically at the top of the file/ script.

Last edited by noir911; 01-29-2005 at 07:47 AM.
 
Old 01-29-2005, 07:15 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I'm sure there's a proper vim (or perl) way, but why not just create your template and define a bash function to do something simple like
Code:
vimpl () {
    cp path/to/perl.tpl $1
    vim $1
}
and add a number count to vim to make the cursor go past the templated portion so you can just start. Something simple like that. Otherwise, I guess look in all the vim docs for what to put in the .vimrc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to invoke passwd phoenix_fei Programming 2 06-03-2005 02:44 AM
invoke xterm through program sudha naidu Programming 2 12-27-2004 03:46 AM
invoke makefile: make invasian Linux - Newbie 2 08-08-2004 01:52 AM
Invoke script on xsession exit? comp12345 Linux - Software 1 06-27-2004 10:27 PM
Want to invoke debugger through JSP. kirti Programming 0 06-11-2004 02:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration