annotate runtime/ftplugin/vim.vim @ 14989:85467d180844 v8.1.0506

patch 8.1.0506: modeline test fails when run by root commit https://github.com/vim/vim/commit/9691f82f862ed18c2e3e48f9d2cd902bb947f803 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 3 19:06:25 2018 +0100 patch 8.1.0506: modeline test fails when run by root Problem: Modeline test fails when run by root. Solution: Set 'modeline' for the test. (James McCoy, closes https://github.com/vim/vim/issues/3592)
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Nov 2018 19:15:08 +0100
parents b178e2039b2d
children 94eda51ba9ba
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>
14519
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
4 " Last Change: 2018 Aug 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
14298
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
17 if !exists('*VimFtpluginUndo')
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
18 func VimFtpluginUndo()
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
19 setl fo< isk< com< tw< commentstring<
14519
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
20 if exists('b:did_add_maps')
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
21 silent! nunmap <buffer> [[
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
22 silent! vunmap <buffer> [[
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
23 silent! nunmap <buffer> ]]
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
24 silent! vunmap <buffer> ]]
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
25 silent! nunmap <buffer> []
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
26 silent! vunmap <buffer> []
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
27 silent! nunmap <buffer> ][
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
28 silent! vunmap <buffer> ][
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
29 silent! nunmap <buffer> ]"
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
30 silent! vunmap <buffer> ]"
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
31 silent! nunmap <buffer> ["
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14298
diff changeset
32 silent! vunmap <buffer> ["
14298
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
33 endif
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
34 unlet! b:match_ignorecase b:match_words b:match_skip b:did_add_maps
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
35 endfunc
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
36 endif
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
37
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
38 let b:undo_ftplugin = "call VimFtpluginUndo()"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " Set 'formatoptions' to break comment lines but not other lines,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " and insert the comment leader when hitting <CR> or using "o".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 setlocal fo-=t fo+=croql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
44 " 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
45 " keyword character. E.g., for netrw#Nread().
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
46 setlocal isk+=#
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
47
12826
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6213
diff changeset
48 " Use :help to lookup the keyword under the cursor with K.
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6213
diff changeset
49 setlocal keywordprg=:help
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6213
diff changeset
50
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Set 'comments' to format dashed lists in comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " Format comments to be up to 78 characters long
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 if &tw == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 setlocal tw=78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " Comments start with a double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 setlocal commentstring=\"%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
13051
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
62 if !exists("no_plugin_maps") && !exists("no_vim_maps")
14298
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
63 let b:did_add_maps = 1
4a588e3afd4a Update runtime files, add Danish translations.
Christian Brabandt <cb@256bit.org>
parents: 13051
diff changeset
64
13051
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
65 " Move around functions.
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
66 nnoremap <silent><buffer> [[ m':call search('^\s*fu\%[nction]\>', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
67 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
68 nnoremap <silent><buffer> ]] m':call search('^\s*fu\%[nction]\>', "W")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
69 vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "W")<CR>
14695
b178e2039b2d Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14519
diff changeset
70 nnoremap <silent><buffer> [] m':call search('^\s*endf\%[unction]\>', "bW")<CR>
b178e2039b2d Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14519
diff changeset
71 vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf\%[unction]\>', "bW")<CR>
b178e2039b2d Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14519
diff changeset
72 nnoremap <silent><buffer> ][ m':call search('^\s*endf\%[unction]\>', "W")<CR>
b178e2039b2d Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14519
diff changeset
73 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
74
13051
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
75 " Move around comments
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
76 nnoremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
77 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
78 nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
a6d3e2081544 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
79 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
80 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " Let the matchit plugin know what items can be matched.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 if exists("loaded_matchit")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 let b:match_ignorecase = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 let b:match_words =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 \ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' .
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
87 \ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
14695
b178e2039b2d Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14519
diff changeset
90 \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,'
6213
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
91 " Ignore syntax region commands and settings, any 'en*' would clobber
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
92 " if-endif.
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
93 " - set spl=de,en
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
94 " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
95 let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
37c24033b260 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5024
diff changeset
96 \ =~? "comment\\|string\\|vimSynReg\\|vimSet"'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
99 let &cpo = s:cpo_save
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
100 unlet s:cpo_save
168
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
101
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
102 " removed this, because 'cpoptions' is a global option.
4d9eabb1396e updated for version 7.0051
vimboss
parents: 24
diff changeset
103 " setlocal cpo+=M " makes \%( match \)