sponsor Vim development Vim logo Vim Book Ad

perl_h2xs : Automate creating perl modules via h2xs

 script karma  Rating 1/3, Downloaded by 1292  Comments, bugs, improvements  Vim wiki

created by
Colin Keith
 
script type
ftplugin
 
description
The Perl_h2xs.vim plugin is a plugin that allows you to automate the process of perl module creation. Writing Perl modules with the recommended structure can be time consuming so this ftplugin automates the process by involking h2xs when you edit a non-existant .pm file. I.e.

  vim Test::Bob.pm

Will invoke h2xs -XAn Test::Bob, and if the module skeleton is created, will swap the edited file to Test/Bob/Bob.pm.

Through the use of variables, you can also set the plugin to create a MANIFEST.SKIP to exclude the CVS directories (and update the MANIFEST to include this new file) and to use CVS to import (or add) the newly created tree to a respository.

It works under windows and unix and you can even create .pm trees in another directory by specifying a directory name and module name in one. I.e.

vim /usr/local/src/Test/Bob.pm

would create the module:

/usr/local/src/Test/Bob/Bob.pm

See the readme file and help docs for detalis.

Enjoy, this is me being lazy :)
 
install details
The tarball contains the files:
  README_perl_h2xs.txt
  ftplugin/perl_h2xs.vim
  doc/perl_h2xs.txt

so you can just untar'gzip the tarball in your local vim directory. I.e. .vim or vim61\vimfiles and all of the files will go into place. Start vim and rebuild your local help docs tags file using

:helptags {docdir}

I.e.

:helptags ~/.vim/doc
:helptags c:\vim61\vimfiles

Contact me if you have problems (with the module that is :-)
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
perl_h2xs_vim.tar.gz 0.51 2002-11-02 6.0 Colin Keith Regexp in  substitution when getting module filenamewasn't anchored so it was turning X::Y::Z => X/Y/Z/Y/Z.pm not X/Y/Z/Z.pm

If module exists you start editing that rather than not checking if it exists and auto starting h2xs. This means you can create with vim X::Y::Z.pm then use !v to go back and you'll edit the module properly, added new var so you can be prompted before this happens if you want.
perl_h2xs_vim.tar.gz 0.5 2002-10-30 6.0 Colin Keith Initial upload
ip used for rating: 18.191.254.0

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github