home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / ftplugin / vim.vim < prev    next >
Encoding:
Text File  |  2003-05-17  |  1.5 KB  |  50 lines

  1. " Vim filetype plugin
  2. " Language:    Vim
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last Change:    2003 May 17
  5.  
  6. " Only do this when not done yet for this buffer
  7. if exists("b:did_ftplugin")
  8.   finish
  9. endif
  10.  
  11. " Don't load another plugin for this buffer
  12. let b:did_ftplugin = 1
  13.  
  14. let cpo_save = &cpo
  15. set cpo-=C
  16.  
  17. let b:undo_ftplugin = "setl fo< com< tw< commentstring<"
  18.     \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
  19.  
  20. " Set 'formatoptions' to break comment lines but not other lines,
  21. " and insert the comment leader when hitting <CR> or using "o".
  22. setlocal fo-=t fo+=croql
  23.  
  24. " Set 'comments' to format dashed lists in comments
  25. setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
  26.  
  27. " Format comments to be up to 78 characters long
  28. setlocal tw=78
  29.  
  30. " Comments start with a double quote
  31. setlocal commentstring=\"%s
  32.  
  33. " Let the matchit plugin know what items can be matched.
  34. if exists("loaded_matchit")
  35.   let b:match_ignorecase = 0
  36.   let b:match_words =
  37.     \ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' .
  38.     \ '\<wh\%[ile]\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<endw\%[hile]\>,' .
  39.     \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
  40.     \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
  41.     \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
  42.     \ '(:)'
  43.   " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif
  44.   let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" ||
  45.     \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'
  46. endif
  47.  
  48. let &cpo = cpo_save
  49. setlocal cpo+=M        " makes \%( match \)
  50.