LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Perl & vi

[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=          " normal mode (undoes t_mr and t_md)
  " :set t_mr=  " reverse (invert) mode
  " :set t_md=    " bold mode
  " :set t_se=    	 " standout end
  " :set t_so=    " standout mode
  " :set t_ue=     	 " underline end
  " :set t_us=       " underline mode start
  "
  :set t_me=
  :set t_mr=
  :set t_md=
  :set t_se=
  :set t_so=
  :set t_ue=
  :set t_us=
  :set t_ZR=
  :set t_ZH=
  ""
  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
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell