annotate runtime/ftplugin/python.vim @ 34211:f9b706e23b10 v9.1.0054

patch 9.1.0054: 'linebreak' may still apply to leading whitespace Commit: https://github.com/vim/vim/commit/703f9bc943a29d947869b5cb0370be2ac42d5ac9 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Jan 25 21:27:13 2024 +0100 patch 9.1.0054: 'linebreak' may still apply to leading whitespace Problem: 'linebreak' may still apply to leading whitespace (VanaIgr) Solution: Compare pointers instead of virtual columns. (zeertzjq) related: neovim/neovim#27180 closes: #13915 Co-authored-by: VanaIgr <vanaigranov@gmail.com> Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 25 Jan 2024 21:45:02 +0100
parents 8ae680be2a51
children d0498ef60b5b
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 file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: python
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
3 " Maintainer: Tom Picton <tom@tompicton.co.uk>
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
4 " Previous Maintainer: James Sully <sullyj3@gmail.com>
9286
64035abb986b commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents: 5663
diff changeset
5 " Previous Maintainer: Johannes Zellner <johannes@zellner.org>
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
6 " Last Change: Mon, 5 October 2020
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 22565
diff changeset
7 " 2024 Jan 14 by Vim Project (browsefilter)
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
8 " https://github.com/tpict/vim-ftplugin-python
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 let b:did_ftplugin = 1
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
12 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
13 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 setlocal cinkeys-=0#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 setlocal indentkeys-=0#
5663
1dea14d4c738 Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents: 5510
diff changeset
17 setlocal include=^\\s*\\(from\\\|import\\)
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
18 setlocal define=^\\s*\\(def\\\|class\\)
13482
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
19
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
20 " For imports with leading .., append / and replace additional .s with ../
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
21 let b:grandparent_match = '^\(.\.\)\(\.*\)'
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
22 let b:grandparent_sub = '\=submatch(1)."/".repeat("../",strlen(submatch(2)))'
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
23
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
24 " For imports with a single leading ., replace it with ./
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
25 let b:parent_match = '^\.\(\.\)\@!'
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
26 let b:parent_sub = './'
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
27
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
28 " Replace any . sandwiched between word characters with /
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
29 let b:child_match = '\(\w\)\.\(\w\)'
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
30 let b:child_sub = '\1/\2'
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
31
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
32 setlocal includeexpr=substitute(substitute(substitute(
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
33 \v:fname,
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
34 \b:grandparent_match,b:grandparent_sub,''),
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
35 \b:parent_match,b:parent_sub,''),
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
36 \b:child_match,b:child_sub,'g')
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
37
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 setlocal suffixesadd=.py
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
39 setlocal comments=b:#,fb:-
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
40 setlocal commentstring=#\ %s
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
13125
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
42 if has('python3')
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
43 setlocal omnifunc=python3complete#Complete
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
44 elseif has('python')
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
45 setlocal omnifunc=pythoncomplete#Complete
13125
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12826
diff changeset
46 endif
626
732c7ae5743e updated for version 7.0180
vimboss
parents: 7
diff changeset
47
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 set wildignore+=*.pyc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
10261
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10153
diff changeset
50 let b:next_toplevel='\v%$\|^(class\|def\|async def)>'
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10153
diff changeset
51 let b:prev_toplevel='\v^(class\|def\|async def)>'
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
52 let b:next_endtoplevel='\v%$\|\S.*\n+(def\|class)'
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
53 let b:prev_endtoplevel='\v\S.*\n+(def\|class)'
10261
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10153
diff changeset
54 let b:next='\v%$\|^\s*(class\|def\|async def)>'
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10153
diff changeset
55 let b:prev='\v^\s*(class\|def\|async def)>'
12826
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
56 let b:next_end='\v\S\n*(%$\|^(\s*\n*)*(class\|def\|async def)\|^\S)'
f690da1b3c04 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
57 let b:prev_end='\v\S\n*(^(\s*\n*)*(class\|def\|async def)\|^\S)'
10153
715d6c5707b8 commit https://github.com/vim/vim/commit/abd468ed0fbcba391e7833feeaa7de3ced841455
Christian Brabandt <cb@256bit.org>
parents: 10140
diff changeset
58
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
59 if !exists('g:no_plugin_maps') && !exists('g:no_python_maps')
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
60 execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
61 execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
62 execute "nnoremap <silent> <buffer> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
63 execute "nnoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
64 execute "nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '". b:next."', 'W', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
65 execute "nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '". b:prev."', 'Wb', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
66 execute "nnoremap <silent> <buffer> ]M :call <SID>Python_jump('n', '". b:next_end."', 'W', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
67 execute "nnoremap <silent> <buffer> [M :call <SID>Python_jump('n', '". b:prev_end."', 'Wb', v:count1, 0)<cr>"
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
68
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
69 execute "onoremap <silent> <buffer> ]] :call <SID>Python_jump('o', '". b:next_toplevel."', 'W', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
70 execute "onoremap <silent> <buffer> [[ :call <SID>Python_jump('o', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
71 execute "onoremap <silent> <buffer> ][ :call <SID>Python_jump('o', '". b:next_endtoplevel."', 'W', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
72 execute "onoremap <silent> <buffer> [] :call <SID>Python_jump('o', '". b:prev_endtoplevel."', 'Wb', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
73 execute "onoremap <silent> <buffer> ]m :call <SID>Python_jump('o', '". b:next."', 'W', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
74 execute "onoremap <silent> <buffer> [m :call <SID>Python_jump('o', '". b:prev."', 'Wb', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
75 execute "onoremap <silent> <buffer> ]M :call <SID>Python_jump('o', '". b:next_end."', 'W', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
76 execute "onoremap <silent> <buffer> [M :call <SID>Python_jump('o', '". b:prev_end."', 'Wb', v:count1, 0)<cr>"
10153
715d6c5707b8 commit https://github.com/vim/vim/commit/abd468ed0fbcba391e7833feeaa7de3ced841455
Christian Brabandt <cb@256bit.org>
parents: 10140
diff changeset
77
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
78 execute "xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '". b:next_toplevel."', 'W', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
79 execute "xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
80 execute "xnoremap <silent> <buffer> ][ :call <SID>Python_jump('x', '". b:next_endtoplevel."', 'W', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
81 execute "xnoremap <silent> <buffer> [] :call <SID>Python_jump('x', '". b:prev_endtoplevel."', 'Wb', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
82 execute "xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '". b:next."', 'W', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
83 execute "xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '". b:prev."', 'Wb', v:count1)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
84 execute "xnoremap <silent> <buffer> ]M :call <SID>Python_jump('x', '". b:next_end."', 'W', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
85 execute "xnoremap <silent> <buffer> [M :call <SID>Python_jump('x', '". b:prev_end."', 'Wb', v:count1, 0)<cr>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
86 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
88 if !exists('*<SID>Python_jump')
13735
a62eeee5f116 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13482
diff changeset
89 fun! <SID>Python_jump(mode, motion, flags, count, ...) range
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
90 let l:startofline = (a:0 >= 1) ? a:1 : 1
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
91
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
92 if a:mode == 'x'
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
93 normal! gv
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
94 endif
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
95
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
96 if l:startofline == 1
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
97 normal! 0
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
98 endif
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
99
13735
a62eeee5f116 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13482
diff changeset
100 let cnt = a:count
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
101 mark '
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
102 while cnt > 0
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
103 call search(a:motion, a:flags)
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
104 let cnt = cnt - 1
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
105 endwhile
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
106
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
107 if l:startofline == 1
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
108 normal! ^
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10261
diff changeset
109 endif
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
110 endfun
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
111 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
113 if has("browsefilter") && !exists("b:browsefilter")
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 22565
diff changeset
114 let b:browsefilter = "Python Files (*.py)\t*.py\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 22565
diff changeset
115 if has("win32")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 22565
diff changeset
116 let b:browsefilter .= "All Files (*.*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 22565
diff changeset
117 else
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 22565
diff changeset
118 let b:browsefilter .= "All Files (*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 22565
diff changeset
119 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 endif
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
121
10153
715d6c5707b8 commit https://github.com/vim/vim/commit/abd468ed0fbcba391e7833feeaa7de3ced841455
Christian Brabandt <cb@256bit.org>
parents: 10140
diff changeset
122 if !exists("g:python_recommended_style") || g:python_recommended_style != 0
715d6c5707b8 commit https://github.com/vim/vim/commit/abd468ed0fbcba391e7833feeaa7de3ced841455
Christian Brabandt <cb@256bit.org>
parents: 10140
diff changeset
123 " As suggested by PEP8.
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
124 setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4
5400
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
125 endif
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
126
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
127 " Use pydoc for keywordprg.
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
128 " Unix users preferentially get pydoc3, then pydoc2.
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
129 " Windows doesn't have a standalone pydoc executable in $PATH by default, nor
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
130 " does it have separate python2/3 executables, so Windows users just get
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
131 " whichever version corresponds to their installed Python version.
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
132 if executable('python3')
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
133 setlocal keywordprg=python3\ -m\ pydoc
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
134 elseif executable('python')
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
135 setlocal keywordprg=python\ -m\ pydoc
5400
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
136 endif
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
137
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
138 " Script for filetype switching to undo the local stuff we may have changed
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
139 let b:undo_ftplugin = 'setlocal cinkeys<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
140 \ . '|setlocal comments<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
141 \ . '|setlocal commentstring<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
142 \ . '|setlocal expandtab<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
143 \ . '|setlocal include<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
144 \ . '|setlocal includeexpr<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
145 \ . '|setlocal indentkeys<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
146 \ . '|setlocal keywordprg<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
147 \ . '|setlocal omnifunc<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
148 \ . '|setlocal shiftwidth<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
149 \ . '|setlocal softtabstop<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
150 \ . '|setlocal suffixesadd<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
151 \ . '|setlocal tabstop<'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
152 \ . '|silent! nunmap <buffer> [M'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
153 \ . '|silent! nunmap <buffer> [['
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
154 \ . '|silent! nunmap <buffer> []'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
155 \ . '|silent! nunmap <buffer> [m'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
156 \ . '|silent! nunmap <buffer> ]M'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
157 \ . '|silent! nunmap <buffer> ]['
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
158 \ . '|silent! nunmap <buffer> ]]'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
159 \ . '|silent! nunmap <buffer> ]m'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
160 \ . '|silent! ounmap <buffer> [M'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
161 \ . '|silent! ounmap <buffer> [['
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
162 \ . '|silent! ounmap <buffer> []'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
163 \ . '|silent! ounmap <buffer> [m'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
164 \ . '|silent! ounmap <buffer> ]M'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
165 \ . '|silent! ounmap <buffer> ]['
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
166 \ . '|silent! ounmap <buffer> ]]'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
167 \ . '|silent! ounmap <buffer> ]m'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
168 \ . '|silent! xunmap <buffer> [M'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
169 \ . '|silent! xunmap <buffer> [['
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
170 \ . '|silent! xunmap <buffer> []'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
171 \ . '|silent! xunmap <buffer> [m'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
172 \ . '|silent! xunmap <buffer> ]M'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
173 \ . '|silent! xunmap <buffer> ]['
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
174 \ . '|silent! xunmap <buffer> ]]'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
175 \ . '|silent! xunmap <buffer> ]m'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
176 \ . '|unlet! b:browsefilter'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
177 \ . '|unlet! b:child_match'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
178 \ . '|unlet! b:child_sub'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
179 \ . '|unlet! b:grandparent_match'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
180 \ . '|unlet! b:grandparent_sub'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
181 \ . '|unlet! b:next'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
182 \ . '|unlet! b:next_end'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
183 \ . '|unlet! b:next_endtoplevel'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
184 \ . '|unlet! b:next_toplevel'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
185 \ . '|unlet! b:parent_match'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
186 \ . '|unlet! b:parent_sub'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
187 \ . '|unlet! b:prev'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
188 \ . '|unlet! b:prev_end'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
189 \ . '|unlet! b:prev_endtoplevel'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
190 \ . '|unlet! b:prev_toplevel'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
191 \ . '|unlet! b:undo_ftplugin'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13735
diff changeset
192
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
193 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
194 unlet s:keepcpo