Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Vim configs: mine

by Aristotle (Chancellor)
on May 20, 2002 at 19:33 UTC ( #167922=note: print w/ replies, xml ) Need Help??


in reply to Vim configs (slightly OT)

Thanks to gmax for a list of excellent nodes. Here's my .vimrc:

" I don't want to become awkward when editing on another machine, " so I stick to as few and as highly effective settings as possible. set nocompatible " we want vim, not vi set ruler " display current position in file set backspace=2 " BS and Del in insert mode allowed and go thro +ugh EOLs set number " line numbers set scrolloff=3 set autoindent set noerrorbells if has("gui_running") set guioptions-=f " fork+detach console set guioptions-=t " no menu tear-off colorscheme peachpuff else set background=dark " my console has black bg endif filetype plugin indent on syntax on " Current directory follows the file being edited autocmd BufEnter * lcd %:p:h " [F4] for quick :make noremap <F4> <ESC>:make<C-M> " [F5] toggles error window noremap <F5> <ESC>:cope<C-M> autocmd BufReadPost quickfix noremap <F5> <ESC>:ccl<C-M>:noremap <lt>F +5> <lt>ESC>:cope<lt>C-M><C-M>:echo ":ccl"<C-M> " [Ctrl-PgUp/Dn] to flip through :make errors noremap <C-PageUp> :cp<C-M> noremap <C-PageDown> :cn<C-M> inoremap <C-PageUp> <ESC>:cp<C-M>i inoremap <C-PageDown> <ESC>:cn<C-M>i " save keystrokes on the Perl shebang iabbrev #!p #!/usr/bin/perl -w<C-M>use strict;<C-M><ESC>:filetype dete +ct<C-M>i
These settings, as they should be, are not language specific (except the abbr). Along with this rc, for Perl coding I have a .vim/ftplugin/perl.vim:
" Vim filetype plugin file " Language: Perl " Maintainer: Dan Sharp <vimuser@crosswinds.net> " Last Change: Sun, 19 May 2002 02:07:22 Central European Standard +Time " Changed By: Aristotle Pagaltzis <pagaltzis@gmx.de> if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting <CR> or using "o". setlocal fo-=t fo+=croql setlocal comments=:# " Make sure the continuation lines below do not cause problems in " compatibility mode. set cpo-=C " Change the browse dialog on Win32 to show mainly Perl-related files if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" . \ "Perl Modules (*.pm)\t*.pm\n" . \ "Perl Documentation Files (*.pod)\t*.pod\n" . \ "All Files (*.*)\t*.*\n" endif " Provided by Ned Konz <ned@bike-nomad.com> "--------------------------------------------- setlocal include=\\<\\(use\|require\\)\\s* setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$',' +.pm','') setlocal isfname=A-Z,a-z,:,48-57,_ setlocal isident=48-57,_,A-Z,a-z setlocal iskeyword=48-57,_,A-Z,a-z,: setlocal define=[^A-Za-z_] " Set this once, globally. if !exists("perlpath") if &shellxquote != '"' let perlpath = system('perl -e "print join(q/,/,@INC)"') else let perlpath = system("perl -e 'print join(q/,/,@INC)'") endif let perlpath = substitute(perlpath,',.$',',,','') endif let &l:path=perlpath setlocal keywordprg=perldoc setlocal makeprg=perl\ -Mstrict\ -wc\ % setlocal errorformat+=%m\ at\ %f\ line\ %l. setlocal grepprg=rgrep\ -n\ -R\ '*.p[ml]'\ $* map <buffer> <C-]> :exec ":tag /".expand("<cword>")
____________
Makeshifts last the longest.


Comment on Re: Vim configs: mine
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2015-07-02 10:41 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 (33 votes), past polls