annotate runtime/ftplugin/python.vim @ 975:f88008797313 v7.0.101

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