diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-01 14:08:45 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-01 14:22:52 -0400 |
commit | b16c7c515c34d2f695a595527594325abc6a640b (patch) | |
tree | d539446f64bc19dbb6fe1ba1f2cbbf965d574c5f /runtime/ftplugin/python.vim | |
parent | b084f49496c91f8f16dced5850774221921c1667 (diff) | |
download | rneovim-b16c7c515c34d2f695a595527594325abc6a640b.tar.gz rneovim-b16c7c515c34d2f695a595527594325abc6a640b.tar.bz2 rneovim-b16c7c515c34d2f695a595527594325abc6a640b.zip |
vim-patch:4f4d51a942cc
Update runtime files.
https://github.com/vim/vim/commit/4f4d51a942cc2c6b3e936ee0f93f00c2d000065c
Omit "??" operator.
Patches v8.2.1794,v8.2.1798 are not ported yet.
Diffstat (limited to 'runtime/ftplugin/python.vim')
-rw-r--r-- | runtime/ftplugin/python.vim | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index 64c1a87a69..000ddf52a3 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -3,7 +3,7 @@ " Maintainer: Tom Picton <tom@tompicton.co.uk> " Previous Maintainer: James Sully <sullyj3@gmail.com> " Previous Maintainer: Johannes Zellner <johannes@zellner.org> -" Last Change: Sun 17 Mar 2019 +" Last Change: Mon, 5 October 2020 " https://github.com/tpict/vim-ftplugin-python if exists("b:did_ftplugin") | finish | endif @@ -14,6 +14,7 @@ set cpo&vim setlocal cinkeys-=0# setlocal indentkeys-=0# setlocal include=^\\s*\\(from\\\|import\\) +setlocal define=^\\s*\\(def\\\|class\\) " For imports with leading .., append / and replace additional .s with ../ let b:grandparent_match = '^\(.\.\)\(\.*\)' @@ -38,7 +39,7 @@ setlocal comments=b:#,fb:- setlocal commentstring=#\ %s if has('python3') - setlocal omnifunc=python3complete#Complete + setlocal omnifunc=python3complete#Complete elseif has('python') setlocal omnifunc=pythoncomplete#Complete endif @@ -115,35 +116,18 @@ endif if !exists("g:python_recommended_style") || g:python_recommended_style != 0 " As suggested by PEP8. - setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 + setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4 endif -" First time: try finding "pydoc". -if !exists('g:pydoc_executable') - if executable('pydoc') - let g:pydoc_executable = 1 - else - let g:pydoc_executable = 0 - endif -endif - -" Windows-specific pydoc setup -if has('win32') || has('win64') - if executable('python') - " available as Tools\scripts\pydoc.py - let g:pydoc_executable = 1 - else - let g:pydoc_executable = 0 - endif -endif - -" If "pydoc" was found use it for keywordprg. -if g:pydoc_executable - if has('win32') || has('win64') - setlocal keywordprg=python\ -m\ pydoc\ - else - setlocal keywordprg=pydoc - endif +" Use pydoc for keywordprg. +" Unix users preferentially get pydoc3, then pydoc2. +" Windows doesn't have a standalone pydoc executable in $PATH by default, nor +" does it have separate python2/3 executables, so Windows users just get +" whichever version corresponds to their installed Python version. +if executable('python3') + setlocal keywordprg=python3\ -m\ pydoc +elseif executable('python') + setlocal keywordprg=python\ -m\ pydoc endif " Script for filetype switching to undo the local stuff we may have changed |