syntax on set nohlsearch set smartindent au FileType mail :set textwidth=72 au FileType mail :omap } /^[ >]*$/[^ >]k0 au FileType mail :omap { ?^[ >]*$?[^ >]j0 "au FileType mail :set nosmartindent au FileType php :set tabstop=2 au FileType php :set shiftwidth=2 au FileType php :set noexpandtab autocmd FileType perl :set shiftwidth=4 ts=4 "turn off audible bell set vb "commenting out multiple lines with ,# etc - nicked from vim.org " lhs comments map ,# :s/^/#/ map ,/ :s/^/\/\// map ,> :s/^/> / map ," :s/^/\"/ map ,% :s/^/%/ map ,! :s/^/!/ map ,; :s/^/;/ map ,- :s/^/--/ map ,c :s/^\/\/\\|^--\\|^> \\|^[#"%!;]// "wrapping comments map ,* :s/^\(.*\)$/\/\* \1 \*\// map ,( :s/^\(.*\)$/\(\* \1 \*\)/ map ,< :s/^\(.*\)$// map ,d :s/^\([/(]\*\\|\)$/\2/ " The following nicked from Glyn Kennington's .vimrc :map @xp :call XMLPATH() :map @cp :call CDSPATH() map Y y$ function! XMLPATH() :perl \ my ($row,$col) = $curwin->Cursor(); \ my @elements; \ my @lines = $curbuf->Get(1 .. $row); \ foreach my $line (@lines) { \ while ($line =~ m|<(/?)\s*([\w:-]+)\b[^>]*?(/?)>|g) { \ if ($3 eq '/') { \ next; \ } elsif ($1 eq '') { \ push @elements, $2 \ } else { \ pop @elements; \ } \ } \ } \ VIM::Msg("XML Path: /".join('/',@elements)) endf function! CDSPATH() :perl \ my ($row,$col) = $curwin->Cursor(); \ my @elements; \ my @lines = $curbuf->Get(1 .. $row); \ foreach my $line (@lines) { \ while ($line =~ m|<(/?)\s*(?:\S*?\:)?element(?:\s+[^>]*name\w*=\w*(["'])([^'"]*)\2)?[^/>]*(/?)>|g) { \ if ($4 eq '/') { \ next; \ } elsif ($1 eq '') { \ push @elements, $3 \ } else { \ pop @elements; \ } \ } \ } \ VIM::Msg("CDS path: /".join('/',@elements)) endf