[Chicago-talk] Notes on vim+perl(+PuTTY)

Andrew Rodland arodland at comcast.net
Thu Mar 15 20:58:52 PDT 2007


Not so much a tutorial as "this is what I do", but people might find some or 
all of these things useful if editing perl in vim

"" Perl-related things

" Create a command "Tidy" -- accept a range but default to whole file
" Any args given to Tidy will be passed to perltidy after your defaults
command -range=% -nargs=* Tidy <line1>,<line2>!
   \perltidy your favorite perltidy options here <args>

" Turn on syntax folding for Perl files
let perl_fold=1
" Fold ifs and loops and such too
let perl_fold_blocks=1
" Highlight POD using syntax/pod.vim
let perl_include_pod
" If you have vim before 7.0...
let perl_extended_vars=1
let perl_want_scope_in_variables=1

"" Other things

" Enable the mouse when working in xterms or on a console with GPM
set mouse=a

" Use 3 columns to show fold markers (clickable, in mouse mode)
set foldcolumn=3

" End of vimrc stuff

This last bit, I may be making up, but I'm pretty sure I'm not -- I believe 
that the windows PuTTY also supports accessing the windows clipboard through 
the xterm clipboard functions, meaning that you should be able to yank into 
the register "+ and have that text come out in the windows clipboard on the 
local machine, and likewise paste from "+ and it will paste what's in the 
clipboard. If that doesn't do it, try "*, and if that doesn't do it, check 
for options (sorry, I don't have a windows machine handy to test it with).

If you want to have even a little more fun with perlish things in vim, there's 
a script called perl-support.vim available from the vim scripts repository at 
< http://www.vim.org/scripts/script.php?script_id=556 > -- it has mappings to 
deal with comments, macros for inserting various bits of code for you to fill 
in the blanks, quickfix support for perl -c (hit a key to pop up a buffer 
with either a "Compiled OK" message or a list of errors from perl -c, and 
jump right to the errors), and perldoc access from right within the module. 
Some fairly nifty stuff there. More info, screenshots, and installation 
instructions at the above-mentioned link.

Anything else anyone wants to know about vim geekery?

Andrew


More information about the Chicago-talk mailing list