LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   vim invoke (https://www.linuxquestions.org/questions/programming-9/vim-invoke-283656/)

noir911 01-29-2005 07:46 AM

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.

slakmagik 01-29-2005 07:15 PM

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.


All times are GMT -5. The time now is 10:05 AM.