7
|
1 " Vim filetype plugin file
|
|
2 " Language: python
|
|
3 " Maintainer: Johannes Zellner <johannes@zellner.org>
|
|
4 " Last Change: Wed, 21 Apr 2004 13:13:08 CEST
|
|
5
|
|
6 if exists("b:did_ftplugin") | finish | endif
|
|
7 let b:did_ftplugin = 1
|
|
8
|
|
9 setlocal cinkeys-=0#
|
|
10 setlocal indentkeys-=0#
|
|
11 setlocal include=\s*\\(from\\\|import\\)
|
|
12 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
|
|
13 setlocal suffixesadd=.py
|
|
14 setlocal comments-=:%
|
|
15 setlocal commentstring=#%s
|
|
16
|
827
|
17 setlocal omnifunc=pythoncomplete#Complete
|
626
|
18
|
7
|
19 set wildignore+=*.pyc
|
|
20
|
|
21 nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
|
|
22 nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
|
|
23 nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
|
|
24 nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
|
|
25
|
|
26 if exists('*<SID>Python_jump') | finish | endif
|
|
27
|
|
28 fun! <SID>Python_jump(motion) range
|
|
29 let cnt = v:count1
|
|
30 let save = @/ " save last search pattern
|
|
31 mark '
|
|
32 while cnt > 0
|
|
33 silent! exe a:motion
|
|
34 let cnt = cnt - 1
|
|
35 endwhile
|
|
36 call histdel('/', -1)
|
|
37 let @/ = save " restore last search pattern
|
|
38 endfun
|
|
39
|
|
40 if has("gui_win32") && !exists("b:browsefilter")
|
|
41 let b:browsefilter = "Python Files (*.py)\t*.py\n" .
|
|
42 \ "All Files (*.*)\t*.*\n"
|
|
43 endif
|