" Vim filetype plugin file" Language: python" Maintainer: James Sully <sullyj3@gmail.com>" Previous Maintainer: Johannes Zellner <johannes@zellner.org>" Last Change: Tue, 09 October 2016" https://github.com/sullyj3/vim-ftplugin-pythonif exists("b:did_ftplugin") | finish | endiflet b:did_ftplugin = 1let s:keepcpo= &cposet cpo&vimsetlocal cinkeys-=0#setlocal indentkeys-=0#setlocal include=^\\s*\\(from\\\|import\\)setlocal includeexpr=substitute(v:fname,'\\.','/','g')setlocal suffixesadd=.pysetlocal comments=b:#,fb:-setlocal commentstring=#\ %ssetlocal omnifunc=pythoncomplete#Completeset wildignore+=*.pyclet b:next_toplevel='\v%$\|^(class\|def\|async def)>'let b:prev_toplevel='\v^(class\|def\|async def)>'let b:next='\v%$\|^\s*(class\|def\|async def)>'let b:prev='\v^\s*(class\|def\|async def)>'execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W')<cr>"execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb')<cr>"execute "nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '". b:next."', 'W')<cr>"execute "nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '". b:prev."', 'Wb')<cr>"execute "onoremap <silent> <buffer> ]] :call <SID>Python_jump('o', '". b:next_toplevel."', 'W')<cr>"execute "onoremap <silent> <buffer> [[ :call <SID>Python_jump('o', '". b:prev_toplevel."', 'Wb')<cr>"execute "onoremap <silent> <buffer> ]m :call <SID>Python_jump('o', '". b:next."', 'W')<cr>"execute "onoremap <silent> <buffer> [m :call <SID>Python_jump('o', '". b:prev."', 'Wb')<cr>"execute "xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '". b:next_toplevel."', 'W')<cr>"execute "xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '". b:prev_toplevel."', 'Wb')<cr>"execute "xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '". b:next."', 'W')<cr>"execute "xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '". b:prev."', 'Wb')<cr>"if !exists('*<SID>Python_jump')fun! <SID>Python_jump(mode, motion, flags) rangeif a:mode == 'x'normal! gvendifnormal! 0let cnt = v:count1mark 'while cnt > 0call search(a:motion, a:flags)let cnt = cnt - 1endwhilenormal! ^endfunendifif has("browsefilter") && !exists("b:browsefilter")let b:browsefilter = "Python Files (*.py)\t*.py\n" .\ "All Files (*.*)\t*.*\n"endifif !exists("g:python_recommended_style") || g:python_recommended_style != 0" As suggested by PEP8.setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8endif" First time: try finding "pydoc".if !exists('g:pydoc_executable')if executable('pydoc')let g:pydoc_executable = 1elselet g:pydoc_executable = 0endifendif" If "pydoc" was found use it for keywordprg.if g:pydoc_executablesetlocal keywordprg=pydocendiflet &cpo = s:keepcpounlet s:keepcpo
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。