[ABE.pm] cool vimrc ideas

Ted Fiedler fiedlert at gmail.com
Wed Jun 21 17:49:09 PDT 2006


Here are some of my favorites

" kill the annoying beep
set vb

" comment out blocks
" ma to mark beginning
" put cursor at the end and hit F5
" code will be commented out
map <F5> :'a,.s/^/#/gi^M:nohl^M

" show matching brackets in Perl
autocmd FileType perl set showmatch

" check perl code with :make
autocmd FileType perl set makeprg=perl\ -c\ %\
autocmd FileType perl set errorformat=%f:%l:%m
autocmd FileType perl set autowrite

" shells
autocmd BufNewFile  *.pm        0r ~/.vim/skeleton.pm
autocmd BufNewFile  *.pl        0r ~/.vim/skeleton.pl
autocmd BufNewFile  *.cgi       0r ~/.vim/skeleton.cgi
autocmd BufNewFile  *.sh        0r ~/.vim/skeleton.sh

skeleton.pl would be something like

#!/usr/bin/perl

use strict;
use warnings;

# use diagnostics;
# use Data:;Dumper;

and whenevr I type vi .pl - I start with that skeleton...

There are others, but those are some of my favorites.

Ted

On 6/21/06, Faber J. Fedor <faber at linuxnj.com> wrote:
> I'm putting together a vimrc files for some programemrs who are new to
> Linux and vim.
>
> What cool things are in your vimrc file that would impress a programmer?
>
> For example, I've got a macro that will insert a timestamp whenever
> Time-stamp: <21 Jun 2006 05:04:44 PM Faber Fedor>  is typed in insert
> mode. Yeah, just like that.  The keystrokes are Q-W-E (the following
> space is important).
>
>
>
> --
>
> Regards,
>
> Faber Fedor
> President
> Linux New Jersey, Inc.
> 908-320-0357
> 800-706-0701
>
> http://www.linuxnj.com
>
>
>
> _______________________________________________
> ABE-pm mailing list
> ABE-pm at pm.org
> http://mail.pm.org/mailman/listinfo/abe-pm
>


-- 
"The Buddha, the Godhead, resides quite as comfortably in the circuits
of a digital computer or the gears of a cycle transmission as he does
at the top of a mountain or in the petals of a flower."
  -- Robert M Pirsig


More information about the ABE-pm mailing list