annotate runtime/ftplugin/vim.vim @ 9834:80ace3687eec v7.4.2192

commit https://github.com/vim/vim/commit/a6b7a08ae04a3cd4d9c45c906bb7a197e2135179 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 10 20:53:05 2016 +0200 patch 7.4.2192 Problem: Generating prototypes with Cygwin doesn't work well. Solution: Change #ifdefs. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Wed, 10 Aug 2016 21:00:08 +0200
parents 37c24033b260
children f690da1b3c04
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
6213
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
4 " Last Change: 2014 Sep 07
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Only do this when not done yet for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " Don't load another plugin for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
14 let s:cpo_save = &cpo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
17 let b:undo_ftplugin = "setl fo< isk< com< tw< commentstring<"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " Set 'formatoptions' to break comment lines but not other lines,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " and insert the comment leader when hitting <CR> or using "o".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 setlocal fo-=t fo+=croql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
24 " To allow tag lookup via CTRL-] for autoload functions, '#' must be a
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
25 " keyword character. E.g., for netrw#Nread().
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
26 setlocal isk+=#
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
27
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " Set 'comments' to format dashed lists in comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " Format comments to be up to 78 characters long
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 if &tw == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 setlocal tw=78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Comments start with a double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 setlocal commentstring=\"%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Move around functions.
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
40 nnoremap <silent><buffer> [[ m':call search('^\s*fu\%[nction]\>', "bW")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
41 vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "bW")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
42 nnoremap <silent><buffer> ]] m':call search('^\s*fu\%[nction]\>', "W")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
43 vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "W")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
44 nnoremap <silent><buffer> [] m':call search('^\s*endf*\%[unction]\>', "bW")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
45 vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf*\%[unction]\>', "bW")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
46 nnoremap <silent><buffer> ][ m':call search('^\s*endf*\%[unction]\>', "W")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
47 vnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf*\%[unction]\>', "W")<CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " Move around comments
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
50 nnoremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
51 vnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
52 nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
53 vnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " Let the matchit plugin know what items can be matched.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 if exists("loaded_matchit")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 let b:match_ignorecase = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let b:match_words =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 \ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' .
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
60 \ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 \ '(:)'
6213
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
65 " Ignore syntax region commands and settings, any 'en*' would clobber
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
66 " if-endif.
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
67 " - set spl=de,en
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
68 " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
69 let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
70 \ =~? "comment\\|string\\|vimSynReg\\|vimSet"'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
73 let &cpo = s:cpo_save
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
74 unlet s:cpo_save
168
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
75
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
76 " removed this, because 'cpoptions' is a global option.
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
77 " setlocal cpo+=M " makes \%( match \)