Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 01-29-2005, 08:46 AM   #1
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" 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 08:47 AM.
Old 01-29-2005, 08:15 PM   #2
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
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.


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 03:44 AM
invoke xterm through program sudha naidu Programming 2 12-27-2004 04:46 AM
invoke makefile: make invasian Linux - Newbie 2 08-08-2004 02:52 AM
Invoke script on xsession exit? comp12345 Linux - Software 1 06-27-2004 11:27 PM
Want to invoke debugger through JSP. kirti Programming 0 06-11-2004 03:30 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:17 PM.

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