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 / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / ftplugin / python.vim < prev    next >
Encoding:
Text File  |  2003-05-24  |  1.2 KB  |  44 lines

  1. " Vim filetype plugin file
  2. " Language:    python
  3. " Maintainer:    Johannes Zellner <johannes@zellner.org>
  4. " Last Change:    Sat, 24 May 2003 12:23:01 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 suffixesadd=.py
  13. " setlocal comments-=:%
  14. setlocal commentstring=#%s
  15.  
  16. " Python always uses a 'tabstop' of 8.
  17. setlocal ts=8
  18.  
  19. set wildignore+=*.pyc
  20.  
  21. nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
  22. nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
  23. nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
  24. nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
  25.  
  26. if exists('*<SID>Python_jump') | finish | endif
  27.  
  28. fun! <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
  38. endfun
  39.  
  40. if has("gui_win32") && !exists("b:browsefilter")
  41.     let b:browsefilter = "Python Files (*.py)\t*.py\n" .
  42.                \ "All Files (*.*)\t*.*\n"
  43. endif
  44.