blob: 4834b40ce40995d82fd7f7a2db5ff2fb4af34920 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" 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
17set wildignore+=*.pyc
18
19nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
20nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
21nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
22nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
23
24if exists('*<SID>Python_jump') | finish | endif
25
26fun! <SID>Python_jump(motion) range
27 let cnt = v:count1
28 let save = @/ " save last search pattern
29 mark '
30 while cnt > 0
31 silent! exe a:motion
32 let cnt = cnt - 1
33 endwhile
34 call histdel('/', -1)
35 let @/ = save " restore last search pattern
36endfun
37
38if has("gui_win32") && !exists("b:browsefilter")
39 let b:browsefilter = "Python Files (*.py)\t*.py\n" .
40 \ "All Files (*.*)\t*.*\n"
41endif