home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vim42os2.zip / vim-4.2 / vimrc < prev    next >
Text File  |  1996-06-18  |  1KB  |  35 lines

  1. " An example for a .vimrc file
  2.  
  3. version 4.0        " avoid warning for wrong version
  4.  
  5. set bs=2        " allow backspacing over everything in insert mode
  6. set ai            " always set autoindenting on
  7. set tw=78        " always limit the width of text to 78
  8. set backup        " keep a backup file
  9. set viminfo='20,\"50    " read/write a .viminfo file, don't store more
  10.             " than 50 lines of registers
  11.  
  12. " When starting to edit a file:
  13. "   For *.c and *.h files set formatting of comments and set C-indenting on
  14. "   For other files switch it off
  15. "   Don't change the sequence, it's important that the line with * comes first.
  16. autocmd BufRead * set formatoptions=tcql nocindent comments&
  17. autocmd BufRead *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
  18.  
  19. " Enable editing of gzipped files
  20. "    read: set binary mode before reading the file
  21. "          uncompress text in buffer after reading
  22. "   write: compress file after writing
  23. "  append: uncompress file, append, compress file
  24. autocmd BufReadPre,FileReadPre      *.gz set bin
  25. autocmd BufReadPost,FileReadPost    *.gz '[,']!gunzip
  26. autocmd BufReadPost,FileReadPost    *.gz set nobin
  27.  
  28. autocmd BufWritePost,FileWritePost  *.gz !mv <afile> <afile>:r
  29. autocmd BufWritePost,FileWritePost  *.gz !gzip <afile>:r
  30.  
  31. autocmd FileAppendPre            *.gz !gunzip <afile>
  32. autocmd FileAppendPre            *.gz !mv <afile>:r <afile>
  33. autocmd FileAppendPost            *.gz !mv <afile> <afile>:r
  34. autocmd FileAppendPost            *.gz !gzip <afile>:r
  35.