Mercurial > vim
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 |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
2 " Language: python | |
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 | 5 " Last Change By Johannes: Wed, 21 Apr 2004 13:13:08 CEST |
7 | 6 |
7 if exists("b:did_ftplugin") | finish | endif | |
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 | 11 |
12 setlocal cinkeys-=0# | |
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 | 15 setlocal includeexpr=substitute(v:fname,'\\.','/','g') |
16 setlocal suffixesadd=.py | |
5510 | 17 setlocal comments=b:#,fb:- |
18 setlocal commentstring=#\ %s | |
7 | 19 |
827 | 20 setlocal omnifunc=pythoncomplete#Complete |
626 | 21 |
7 | 22 set wildignore+=*.pyc |
23 | |
24 nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr> | |
25 nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr> | |
26 nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr> | |
27 nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr> | |
28 | |
5510 | 29 if !exists('*<SID>Python_jump') |
30 fun! <SID>Python_jump(motion) range | |
31 let cnt = v:count1 | |
32 let save = @/ " save last search pattern | |
33 mark ' | |
34 while cnt > 0 | |
35 silent! exe a:motion | |
36 let cnt = cnt - 1 | |
37 endwhile | |
38 call histdel('/', -1) | |
39 let @/ = save " restore last search pattern | |
40 endfun | |
41 endif | |
7 | 42 |
5510 | 43 if has("browsefilter") && !exists("b:browsefilter") |
7 | 44 let b:browsefilter = "Python Files (*.py)\t*.py\n" . |
45 \ "All Files (*.*)\t*.*\n" | |
46 endif | |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
827
diff
changeset
|
47 |
5400 | 48 " As suggested by PEP8. |
49 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 | |
50 | |
51 " First time: try finding "pydoc". | |
52 if !exists('g:pydoc_executable') | |
53 if executable('pydoc') | |
54 let g:pydoc_executable = 1 | |
55 else | |
56 let g:pydoc_executable = 0 | |
57 endif | |
58 endif | |
59 " If "pydoc" was found use it for keywordprg. | |
60 if g:pydoc_executable | |
61 setlocal keywordprg=pydoc | |
62 endif | |
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 |