annotate runtime/ftplugin/python.vim @ 9842:f8396c6e5709 v7.4.2196

commit https://github.com/vim/vim/commit/91c5262b19fd2e558fe87b78c7767c7c5a270be8 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 10 23:02:45 2016 +0200 patch 7.4.2196 Problem: glob2regpat test doesn't test everything on MS-Windows. Solution: Add patterns with backslash handling.
author Christian Brabandt <cb@256bit.org>
date Wed, 10 Aug 2016 23:15:06 +0200
parents 619a98a67f67
children b11ceef7116e
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
9286
64035abb986b commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents: 5663
diff changeset
3 " Maintainer: James Sully <sullyj3@gmail.com>
64035abb986b commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents: 5663
diff changeset
4 " Previous Maintainer: Johannes Zellner <johannes@zellner.org>
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
5 " Last Change: Wed, 29 June 2016
9286
64035abb986b commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents: 5663
diff changeset
6 " https://github.com/sullyj3/vim-ftplugin-python
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 let b:did_ftplugin = 1
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
10 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
11 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 setlocal cinkeys-=0#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 setlocal indentkeys-=0#
5663
1dea14d4c738 Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents: 5510
diff changeset
15 setlocal include=^\\s*\\(from\\\|import\\)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 setlocal suffixesadd=.py
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
18 setlocal comments=b:#,fb:-
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
19 setlocal commentstring=#\ %s
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
827
fd1b3406fd1c updated for version 7.0d02
vimboss
parents: 626
diff changeset
21 setlocal omnifunc=pythoncomplete#Complete
626
732c7ae5743e updated for version 7.0180
vimboss
parents: 7
diff changeset
22
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 set wildignore+=*.pyc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
25 nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '\v%$\|^(class\|def)>', 'W')<cr>
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
26 nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '\v^(class\|def)>', 'Wb')<cr>
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
27 nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '\v%$\|^\s*(class\|def)>', 'W')<cr>
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
28 nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '\v^\s*(class\|def)>', 'Wb')<cr>
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
29
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
30 xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '\v%$\|^(class\|def)>', 'W')<cr>
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
31 xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '\v^(class\|def)>', 'Wb')<cr>
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
32 xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '\v%$\|^\s*(class\|def)>', 'W')<cr>
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
33 xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '\v^\s*(class\|def)>', 'Wb')<cr>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
35 if !exists('*<SID>Python_jump')
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
36 fun! <SID>Python_jump(mode, motion, flags) range
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
37 if a:mode == 'x'
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
38 normal! gv
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
39 endif
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
40
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
41 normal! 0
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
42
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
43 let cnt = v:count1
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
44 mark '
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
45 while cnt > 0
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
46 call search(a:motion, a:flags)
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
47 let cnt = cnt - 1
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
48 endwhile
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
49
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
50 normal! ^
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
51 endfun
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
52 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
54 if has("browsefilter") && !exists("b:browsefilter")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 let b:browsefilter = "Python Files (*.py)\t*.py\n" .
9407
619a98a67f67 commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents: 9286
diff changeset
56 \ "All Files (*.*)\t*.*\n"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 endif
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
58
5400
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
59 " As suggested by PEP8.
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
60 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
61
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
62 " First time: try finding "pydoc".
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
63 if !exists('g:pydoc_executable')
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
64 if executable('pydoc')
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
65 let g:pydoc_executable = 1
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
66 else
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
67 let g:pydoc_executable = 0
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
68 endif
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
69 endif
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
70 " If "pydoc" was found use it for keywordprg.
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
71 if g:pydoc_executable
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
72 setlocal keywordprg=pydoc
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
73 endif
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
74
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
75 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
76 unlet s:keepcpo