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 6if exists("b:did_ftplugin") | finish | endif 7let b:did_ftplugin = 1 8 9setlocal cinkeys-=0# 10setlocal indentkeys-=0# 11setlocal include=\s*\\(from\\\|import\\) 12setlocal includeexpr=substitute(v:fname,'\\.','/','g') 13setlocal suffixesadd=.py 14setlocal comments-=:% 15setlocal commentstring=#%s 16 17setlocal omnifunc=pythoncomplete#Complete 18 19set wildignore+=*.pyc 20 21nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr> 22nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr> 23nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr> 24nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr> 25 26if exists('*<SID>Python_jump') | finish | endif 27 28fun! <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 38endfun 39 40if has("gui_win32") && !exists("b:browsefilter") 41 let b:browsefilter = "Python Files (*.py)\t*.py\n" . 42 \ "All Files (*.*)\t*.*\n" 43endif 44