From 2648c3579a4d274ee46f83db1bd63af38fa9e0a7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 28 Apr 2017 21:33:15 +0200 Subject: vim-patch:abd468ed0fbc Updated runtime files https://github.com/vim/vim/commit/abd468ed0fbcba391e7833feeaa7de3ced841455 --- runtime/ftplugin/python.vim | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'runtime/ftplugin/python.vim') diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index df5dab8afc..546e3bd560 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -2,7 +2,7 @@ " Language: python " Maintainer: James Sully " Previous Maintainer: Johannes Zellner -" Last Change: Wed, 29 June 2016 +" Last Change: Tue, 09 October 2016 " https://github.com/sullyj3/vim-ftplugin-python if exists("b:did_ftplugin") | finish | endif @@ -22,15 +22,25 @@ setlocal omnifunc=pythoncomplete#Complete set wildignore+=*.pyc -nnoremap ]] :call Python_jump('n', '\v%$\|^(class\|def)>', 'W') -nnoremap [[ :call Python_jump('n', '\v^(class\|def)>', 'Wb') -nnoremap ]m :call Python_jump('n', '\v%$\|^\s*(class\|def)>', 'W') -nnoremap [m :call Python_jump('n', '\v^\s*(class\|def)>', 'Wb') +let 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)>' -xnoremap ]] :call Python_jump('x', '\v%$\|^(class\|def)>', 'W') -xnoremap [[ :call Python_jump('x', '\v^(class\|def)>', 'Wb') -xnoremap ]m :call Python_jump('x', '\v%$\|^\s*(class\|def)>', 'W') -xnoremap [m :call Python_jump('x', '\v^\s*(class\|def)>', 'Wb') +execute "nnoremap ]] :call Python_jump('n', '". b:next_toplevel."', 'W')" +execute "nnoremap [[ :call Python_jump('n', '". b:prev_toplevel."', 'Wb')" +execute "nnoremap ]m :call Python_jump('n', '". b:next."', 'W')" +execute "nnoremap [m :call Python_jump('n', '". b:prev."', 'Wb')" + +execute "onoremap ]] :call Python_jump('o', '". b:next_toplevel."', 'W')" +execute "onoremap [[ :call Python_jump('o', '". b:prev_toplevel."', 'Wb')" +execute "onoremap ]m :call Python_jump('o', '". b:next."', 'W')" +execute "onoremap [m :call Python_jump('o', '". b:prev."', 'Wb')" + +execute "xnoremap ]] :call Python_jump('x', '". b:next_toplevel."', 'W')" +execute "xnoremap [[ :call Python_jump('x', '". b:prev_toplevel."', 'Wb')" +execute "xnoremap ]m :call Python_jump('x', '". b:next."', 'W')" +execute "xnoremap [m :call Python_jump('x', '". b:prev."', 'Wb')" if !exists('*Python_jump') fun! Python_jump(mode, motion, flags) range @@ -56,8 +66,10 @@ if has("browsefilter") && !exists("b:browsefilter") \ "All Files (*.*)\t*.*\n" endif -" As suggested by PEP8. -setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 +if !exists("g:python_recommended_style") || g:python_recommended_style != 0 + " As suggested by PEP8. + setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 +endif " First time: try finding "pydoc". if !exists('g:pydoc_executable') -- cgit