Mercurial > vim
comparison runtime/ftplugin/vim.vim @ 2034:7bc41231fbc7
Update runtime files.
author | Bram Moolenaar <bram@zimbu.org> |
---|---|
date | Wed, 06 Jan 2010 20:54:52 +0100 |
parents | 149d8b46404c |
children | 2cfb68fa26cd |
comparison
equal
deleted
inserted
replaced
2033:de5a43c5eedc | 2034:7bc41231fbc7 |
---|---|
1 " Vim filetype plugin | 1 " Vim filetype plugin |
2 " Language: Vim | 2 " Language: Vim |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | 3 " Maintainer: Bram Moolenaar <Bram@vim.org> |
4 " Last Change: 2008 Feb 27 | 4 " Last Change: 2009 Jan 22 |
5 | 5 |
6 " Only do this when not done yet for this buffer | 6 " Only do this when not done yet for this buffer |
7 if exists("b:did_ftplugin") | 7 if exists("b:did_ftplugin") |
8 finish | 8 finish |
9 endif | 9 endif |
10 | 10 |
11 " Don't load another plugin for this buffer | 11 " Don't load another plugin for this buffer |
12 let b:did_ftplugin = 1 | 12 let b:did_ftplugin = 1 |
13 | 13 |
14 let cpo_save = &cpo | 14 let s:cpo_save = &cpo |
15 set cpo-=C | 15 set cpo-=C |
16 | 16 |
17 let b:undo_ftplugin = "setl fo< com< tw< commentstring<" | 17 let b:undo_ftplugin = "setl fo< isk< com< tw< commentstring<" |
18 \ . "| unlet! b:match_ignorecase b:match_words b:match_skip" | 18 \ . "| unlet! b:match_ignorecase b:match_words b:match_skip" |
19 | 19 |
20 " Set 'formatoptions' to break comment lines but not other lines, | 20 " Set 'formatoptions' to break comment lines but not other lines, |
21 " and insert the comment leader when hitting <CR> or using "o". | 21 " and insert the comment leader when hitting <CR> or using "o". |
22 setlocal fo-=t fo+=croql | 22 setlocal fo-=t fo+=croql |
23 | |
24 " To allow tag lookup via CTRL-] for autoload functions, '#' must be a | |
25 " keyword character. E.g., for netrw#Nread(). | |
26 setlocal isk+=# | |
23 | 27 |
24 " Set 'comments' to format dashed lists in comments | 28 " Set 'comments' to format dashed lists in comments |
25 setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\" | 29 setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\" |
26 | 30 |
27 " Format comments to be up to 78 characters long | 31 " Format comments to be up to 78 characters long |
51 " Let the matchit plugin know what items can be matched. | 55 " Let the matchit plugin know what items can be matched. |
52 if exists("loaded_matchit") | 56 if exists("loaded_matchit") |
53 let b:match_ignorecase = 0 | 57 let b:match_ignorecase = 0 |
54 let b:match_words = | 58 let b:match_words = |
55 \ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' . | 59 \ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' . |
56 \ '\<wh\%[ile]\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<endw\%[hile]\>,' . | 60 \ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' . |
57 \ '\<for\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<endfo\%[r]\>,' . | |
58 \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' . | 61 \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' . |
59 \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' . | 62 \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' . |
60 \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' . | 63 \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' . |
61 \ '(:)' | 64 \ '(:)' |
62 " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif | 65 " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif |
63 let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" || | 66 let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" || |
64 \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"' | 67 \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"' |
65 endif | 68 endif |
66 | 69 |
67 let &cpo = cpo_save | 70 let &cpo = s:cpo_save |
71 unlet s:cpo_save | |
68 | 72 |
69 " removed this, because 'cpoptions' is a global option. | 73 " removed this, because 'cpoptions' is a global option. |
70 " setlocal cpo+=M " makes \%( match \) | 74 " setlocal cpo+=M " makes \%( match \) |