annotate runtime/ftplugin/python.vim @ 8282:979b6b144d70

Added tag v7.4.1433 for changeset 74b15ed0a259ddedb2f437f3f0069c8280ea1274
author Christian Brabandt <cb@256bit.org>
date Sat, 27 Feb 2016 18:15:07 +0100
parents 1dea14d4c738
children 64035abb986b
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Johannes Zellner <johannes@zellner.org>
5663
1dea14d4c738 Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents: 5510
diff changeset
4 " Last Change: 2014 Feb 09
5400
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
5 " Last Change By Johannes: Wed, 21 Apr 2004 13:13:08 CEST
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 let b:did_ftplugin = 1
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
9 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
10 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 setlocal cinkeys-=0#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 setlocal indentkeys-=0#
5663
1dea14d4c738 Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents: 5510
diff changeset
14 setlocal include=^\\s*\\(from\\\|import\\)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 setlocal suffixesadd=.py
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
17 setlocal comments=b:#,fb:-
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
18 setlocal commentstring=#\ %s
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
827
fd1b3406fd1c updated for version 7.0d02
vimboss
parents: 626
diff changeset
20 setlocal omnifunc=pythoncomplete#Complete
626
732c7ae5743e updated for version 7.0180
vimboss
parents: 7
diff changeset
21
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 set wildignore+=*.pyc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
29 if !exists('*<SID>Python_jump')
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
30 fun! <SID>Python_jump(motion) range
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
31 let cnt = v:count1
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
32 let save = @/ " save last search pattern
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
33 mark '
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
34 while cnt > 0
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
35 silent! exe a:motion
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
36 let cnt = cnt - 1
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
37 endwhile
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
38 call histdel('/', -1)
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
39 let @/ = save " restore last search pattern
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
40 endfun
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
41 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
5510
d7d7bac1a163 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5400
diff changeset
43 if has("browsefilter") && !exists("b:browsefilter")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 let b:browsefilter = "Python Files (*.py)\t*.py\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 endif
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
47
5400
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
48 " As suggested by PEP8.
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
49 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
50
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
51 " First time: try finding "pydoc".
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
52 if !exists('g:pydoc_executable')
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
53 if executable('pydoc')
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
54 let g:pydoc_executable = 1
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
55 else
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
56 let g:pydoc_executable = 0
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
57 endif
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
58 endif
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
59 " If "pydoc" was found use it for keywordprg.
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
60 if g:pydoc_executable
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
61 setlocal keywordprg=pydoc
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
62 endif
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
63
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
64 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 827
diff changeset
65 unlet s:keepcpo