Mercurial > vim
annotate runtime/ftplugin/python.vim @ 9286:64035abb986b
commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 12 23:01:46 2016 +0200
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Jun 2016 23:15:06 +0200 |
parents | 1dea14d4c738 |
children | 619a98a67f67 |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
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> |
64035abb986b
commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
5 " Last Change: Fri, 10 June 2016 |
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 | 7 |
8 if exists("b:did_ftplugin") | finish | endif | |
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 | 12 |
13 setlocal cinkeys-=0# | |
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 | 16 setlocal includeexpr=substitute(v:fname,'\\.','/','g') |
17 setlocal suffixesadd=.py | |
5510 | 18 setlocal comments=b:#,fb:- |
19 setlocal commentstring=#\ %s | |
7 | 20 |
827 | 21 setlocal omnifunc=pythoncomplete#Complete |
626 | 22 |
7 | 23 set wildignore+=*.pyc |
24 | |
9286
64035abb986b
commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
25 nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)\>')<cr> |
64035abb986b
commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
26 nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)\>')<cr> |
64035abb986b
commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
27 nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)\>')<cr> |
64035abb986b
commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
28 nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)\>')<cr> |
7 | 29 |
5510 | 30 if !exists('*<SID>Python_jump') |
31 fun! <SID>Python_jump(motion) range | |
32 let cnt = v:count1 | |
33 let save = @/ " save last search pattern | |
34 mark ' | |
35 while cnt > 0 | |
36 silent! exe a:motion | |
37 let cnt = cnt - 1 | |
38 endwhile | |
39 call histdel('/', -1) | |
40 let @/ = save " restore last search pattern | |
41 endfun | |
42 endif | |
7 | 43 |
5510 | 44 if has("browsefilter") && !exists("b:browsefilter") |
7 | 45 let b:browsefilter = "Python Files (*.py)\t*.py\n" . |
46 \ "All Files (*.*)\t*.*\n" | |
47 endif | |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
827
diff
changeset
|
48 |
5400 | 49 " As suggested by PEP8. |
50 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 | |
51 | |
52 " First time: try finding "pydoc". | |
53 if !exists('g:pydoc_executable') | |
54 if executable('pydoc') | |
55 let g:pydoc_executable = 1 | |
56 else | |
57 let g:pydoc_executable = 0 | |
58 endif | |
59 endif | |
60 " If "pydoc" was found use it for keywordprg. | |
61 if g:pydoc_executable | |
62 setlocal keywordprg=pydoc | |
63 endif | |
64 | |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
827
diff
changeset
|
65 let &cpo = s:keepcpo |
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
827
diff
changeset
|
66 unlet s:keepcpo |