diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-11-02 22:58:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-11-02 22:58:42 +0100 |
commit | 01164a6546b4c635daf96a1f17d1cb2d07f32a66 (patch) | |
tree | 6e3ff8b26170448c1ee8c53e904738ddc10287e8 /runtime/ftplugin | |
parent | ea84df8041dbbff95acb1db8532281679c5fbe5a (diff) | |
download | vim-git-01164a6546b4c635daf96a1f17d1cb2d07f32a66.tar.gz |
Long overdue runtime update.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/c.vim | 6 | ||||
-rw-r--r-- | runtime/ftplugin/gdb.vim | 12 | ||||
-rw-r--r-- | runtime/ftplugin/neomuttrc.vim | 23 | ||||
-rw-r--r-- | runtime/ftplugin/python.vim | 35 |
4 files changed, 67 insertions, 9 deletions
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 5c9543845..371a78cbc 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2016 Jun 12 +" Last Change: 2017 Sep 28 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -35,8 +35,8 @@ if has("vms") endif " When the matchit plugin is loaded, this makes the % command skip parens and -" braces in comments. -let b:match_words = &matchpairs . ',^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' +" braces in comments properly. +let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' let b:match_skip = 's:comment\|string\|character\|special' " Win32 can filter files in the browse dialog diff --git a/runtime/ftplugin/gdb.vim b/runtime/ftplugin/gdb.vim new file mode 100644 index 000000000..2473b13af --- /dev/null +++ b/runtime/ftplugin/gdb.vim @@ -0,0 +1,12 @@ +" Vim filetype plugin file +" Language: gdb +" Maintainer: Michaƫl Peeters <NOSPAMm.vim@noekeon.org> +" Last Changed: 26 Oct 2017 + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +setlocal commentstring=#%s + +" Undo the stuff we changed. +let b:undo_ftplugin = "setlocal cms<" diff --git a/runtime/ftplugin/neomuttrc.vim b/runtime/ftplugin/neomuttrc.vim new file mode 100644 index 000000000..86f1cded6 --- /dev/null +++ b/runtime/ftplugin/neomuttrc.vim @@ -0,0 +1,23 @@ +" Vim filetype plugin file +" Language: NeoMutt RC File +" Previous Maintainer: Guillaume Brogi <gui-gui@netcourrier.com> +" Latest Revision: 2017-09-17 +" Original version copied from ftplugin/muttrc.vim + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let b:undo_ftplugin = "setl com< cms< inc< fo<" + +setlocal comments=:# commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +let &l:include = '^\s*source\>' + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index 546e3bd56..d52a338b5 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -1,9 +1,10 @@ " Vim filetype plugin file " Language: python -" Maintainer: James Sully <sullyj3@gmail.com> +" Maintainer: Tom Picton <tom@tompicton.co.uk> +" Previous 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-python +" Last Change: Fri, 20 October 2017 +" https://github.com/tpict/vim-ftplugin-python if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -24,31 +25,51 @@ set wildignore+=*.pyc let b:next_toplevel='\v%$\|^(class\|def\|async def)>' let b:prev_toplevel='\v^(class\|def\|async def)>' +let b:next_endtoplevel='\v%$\|\S.*\n+(def\|class)' +let b:prev_endtoplevel='\v\S.*\n+(def\|class)' let b:next='\v%$\|^\s*(class\|def\|async def)>' let b:prev='\v^\s*(class\|def\|async def)>' +let b:next_end='\v\S\n*(%$\|^\s*(class\|def\|async def)\|^\S)' +let b:prev_end='\v\S\n*(^\s*(class\|def\|async def)\|^\S)' 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> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', 0)<cr>" +execute "nnoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0)<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 "nnoremap <silent> <buffer> ]M :call <SID>Python_jump('n', '". b:next_end."', 'W', 0)<cr>" +execute "nnoremap <silent> <buffer> [M :call <SID>Python_jump('n', '". b:prev_end."', 'Wb', 0)<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> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', 0)<cr>" +execute "onoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0)<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 "onoremap <silent> <buffer> ]M :call <SID>Python_jump('o', '". b:next_end."', 'W', 0)<cr>" +execute "onoremap <silent> <buffer> [M :call <SID>Python_jump('o', '". b:prev_end."', 'Wb', 0)<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> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', 0)<cr>" +execute "xnoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0)<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>" +execute "xnoremap <silent> <buffer> ]M :call <SID>Python_jump('x', '". b:next_end."', 'W', 0)<cr>" +execute "xnoremap <silent> <buffer> [M :call <SID>Python_jump('x', '". b:prev_end."', 'Wb', 0)<cr>" if !exists('*<SID>Python_jump') - fun! <SID>Python_jump(mode, motion, flags) range + fun! <SID>Python_jump(mode, motion, flags, ...) range + let l:startofline = (a:0 >= 1) ? a:1 : 1 + if a:mode == 'x' normal! gv endif - normal! 0 + if l:startofline == 1 + normal! 0 + endif let cnt = v:count1 mark ' @@ -57,7 +78,9 @@ if !exists('*<SID>Python_jump') let cnt = cnt - 1 endwhile - normal! ^ + if l:startofline == 1 + normal! ^ + endif endfun endif |