Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Create and edit new scripts

by teamster_jr (Curate)
on May 05, 2006 at 10:11 UTC ( #547617=note: print w/ replies, xml ) Need Help??


in reply to Create and edit new scripts

I know i'm late to this party, but i have this in my .vimrc:

function! New_Plugin(x) let mfile=a:x let packname=substitute(a:x, ".pm$","","") if a:x !~ '\.pm$' let mfile=mfile.".pm" endif execute ':e Plugins/' . mfile :r files/stub.pm :0d execute "%s/STUB/" .substitute(packname, "/", "::", "g") endfunction
This takes a stub file and copies it into a plugins directory (for use with Module::Pluggable), renames the package line and opens it for editing (it also works with subpackages). I also have this:
function! New_Template(x) let mfile = a:x if a:x !~ '\.tt$' let mfile = mfile . ".tt" endif execute ':e Templates/' . mfile endfunction
For template toolkit templates (it doesn't use a stub, but will create a tt template in the correct place).
a


Comment on Re: Create and edit new scripts
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://547617]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-07-31 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls