annotate runtime/ftplugin/vim.vim @ 13619:41ed86454233

Added tag v8.0.1681 for changeset ea4f2a8040b4ab7111c02c71aa587e2ac121aa6b
author Christian Brabandt <cb@256bit.org>
date Tue, 10 Apr 2018 12:45:07 +0200
parents a6d3e2081544
children 4a588e3afd4a
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>
13051
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
4 " Last Change: 2017 Dec 05
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
12826
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6213
diff changeset
28 " Use :help to lookup the keyword under the cursor with K.
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6213
diff changeset
29 setlocal keywordprg=:help
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6213
diff changeset
30
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " Set 'comments' to format dashed lists in comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " Format comments to be up to 78 characters long
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 if &tw == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 setlocal tw=78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Comments start with a double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 setlocal commentstring=\"%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
13051
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
42 if !exists("no_plugin_maps") && !exists("no_vim_maps")
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
43 " Move around functions.
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
44 nnoremap <silent><buffer> [[ m':call search('^\s*fu\%[nction]\>', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
45 vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
46 nnoremap <silent><buffer> ]] m':call search('^\s*fu\%[nction]\>', "W")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
47 vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "W")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
48 nnoremap <silent><buffer> [] m':call search('^\s*endf*\%[unction]\>', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
49 vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf*\%[unction]\>', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
50 nnoremap <silent><buffer> ][ m':call search('^\s*endf*\%[unction]\>', "W")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
51 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
52
13051
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
53 " Move around comments
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
54 nnoremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
55 vnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
56 nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
57 vnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
58 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " Let the matchit plugin know what items can be matched.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 if exists("loaded_matchit")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 let b:match_ignorecase = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 let b:match_words =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 \ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' .
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
65 \ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 \ '(:)'
6213
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
70 " Ignore syntax region commands and settings, any 'en*' would clobber
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
71 " if-endif.
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
72 " - set spl=de,en
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
73 " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
74 let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
75 \ =~? "comment\\|string\\|vimSynReg\\|vimSet"'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
78 let &cpo = s:cpo_save
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
79 unlet s:cpo_save
168
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
80
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
81 " removed this, because 'cpoptions' is a global option.
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
82 " setlocal cpo+=M " makes \%( match \)