home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / ftplugin / python.vim < prev    next >
Encoding:
Text File  |  2012-05-31  |  1.3 KB  |  49 lines

  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. let s:keepcpo= &cpo
  9. set cpo&vim
  10.  
  11. setlocal cinkeys-=0#
  12. setlocal indentkeys-=0#
  13. setlocal include=\s*\\(from\\\|import\\)
  14. setlocal includeexpr=substitute(v:fname,'\\.','/','g')
  15. setlocal suffixesadd=.py
  16. setlocal comments-=:%
  17. setlocal commentstring=#%s
  18.  
  19. setlocal omnifunc=pythoncomplete#Complete
  20.  
  21. set wildignore+=*.pyc
  22.  
  23. nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
  24. nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
  25. nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
  26. nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
  27.  
  28. if exists('*<SID>Python_jump') | finish | endif
  29.  
  30. fun! <SID>Python_jump(motion) range
  31.     let cnt = v:count1
  32.     let save = @/    " save last search pattern
  33.     mark '
  34.     while cnt > 0
  35.     silent! exe a:motion
  36.     let cnt = cnt - 1
  37.     endwhile
  38.     call histdel('/', -1)
  39.     let @/ = save    " restore last search pattern
  40. endfun
  41.  
  42. if has("gui_win32") && !exists("b:browsefilter")
  43.     let b:browsefilter = "Python Files (*.py)\t*.py\n" .
  44.                \ "All Files (*.*)\t*.*\n"
  45. endif
  46.  
  47. let &cpo = s:keepcpo
  48. unlet s:keepcpo
  49.