[ILUG] Perl & vi
Justin Mason
jm at jmason.org
Fri Nov 26 15:37:30 GMT 1999
Brian Nesbitt said:
> Has anyone got a .exrc file that colours perl in vim? If so
> could you mail me a copy.
Sure -- here's mine. This needs to be called .vimrc BTW AFAIK. Make
sure it includes "syntax on" 'cos that's the line that does the magic!
--j.
version 5.0
"
set autoindent
set vb
"
set mouse=h
"
" vi-style, only one level of undo/redo
set undolevels=0
"
set sw=2 report=1 ai ap noic nomesg noslowopen noterse nonu optimize beautify
set bs=2 showcmd ttyfast nottybuiltin
""
" :set t_me=[0m " normal mode (undoes t_mr and t_md)
" :set t_mr=[0;1;33;44m " reverse (invert) mode
" :set t_md=[1;33;41m " bold mode
" :set t_se=[0m " standout end
" :set t_so=[1;32;45m " standout mode
" :set t_ue=[0m " underline end
" :set t_us=[1;32m " underline mode start
"
:set t_me=[0m
:set t_mr=[7;30m
:set t_md=[1;31m
:set t_se=[0m
:set t_so=[0;32m
:set t_ue=[0m
:set t_us=[4;34m
:set t_ZR=[0m
:set t_ZH=[0;35m
""
augroup cprog
" Remove all cprog autocommands
au!
" When starting to edit a file:
" For *.c and *.h files set formatting of comments and set C-indenting on.
" For other files switch it off.
" Don't change the order, it's important that the line with * comes first.
autocmd BufRead * set formatoptions=tclq nocindent comments&
autocmd BufRead *.c,*.h set formatoptions=croq2 textwidth=70 cindent comments=sr:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
augroup END
augroup gzip
" Remove all gzip autocommands
au!
" Enable editing of gzipped files
" read: set binary mode before reading the file
" uncompress text in buffer after reading
" write: compress file after writing
" append: uncompress file, append, compress file
autocmd BufReadPre,FileReadPre *.gz set bin
autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
autocmd BufReadPost,FileReadPost *.gz set nobin
autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . %:r
autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
autocmd FileAppendPre *.gz !gunzip <afile>
autocmd FileAppendPre *.gz !mv <afile>:r <afile>
autocmd FileAppendPost *.gz !mv <afile> <afile>:r
autocmd FileAppendPost *.gz !gzip <afile>:r
augroup END
set background=dark
syntax on
source $VIM/syntax/syntax.vim
hi Normal guifg=Yellow guibg=MidnightBlue
hi Comment ctermfg=1 guifg=OrangeRed1 term=NONE guibg=MidnightBlue
hi Constant ctermfg=4 guifg=LightBlue1 term=NONE guibg=MidnightBlue
hi Identifier ctermfg=6 guifg=LightCyan term=NONE guibg=MidnightBlue
hi Statement ctermfg=3 guifg=LightYellow1 term=NONE guibg=MidnightBlue
hi PreProc ctermfg=4 guifg=LightBlue1 term=NONE guibg=MidnightBlue
hi Type ctermfg=2 guifg=SeaGreen1 term=NONE guibg=MidnightBlue
hi Special ctermfg=7 guifg=white term=NONE guibg=MidnightBlue
hi Search term=standout ctermbg=DarkRed cterm=bold guibg=DarkRed
au BufNewFile,BufReadPost */Mail/drafts/* so $VIM/syntax/mail.vim
au BufNewFile,BufReadPost */Mail/drafts/* set tw=74
More information about the ILUG
mailing list