comparison runtime/ftplugin/python.vim @ 7:3fc0f57ecb91 v7.0001

updated for version 7.0001
author vimboss
date Sun, 13 Jun 2004 20:20:40 +0000
parents
children 732c7ae5743e
comparison
equal deleted inserted replaced
6:c2daee826b8f 7:3fc0f57ecb91
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
17 set wildignore+=*.pyc
18
19 nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
20 nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
21 nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
22 nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
23
24 if exists('*<SID>Python_jump') | finish | endif
25
26 fun! <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
36 endfun
37
38 if has("gui_win32") && !exists("b:browsefilter")
39 let b:browsefilter = "Python Files (*.py)\t*.py\n" .
40 \ "All Files (*.*)\t*.*\n"
41 endif