diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:39:54 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:39:54 +0000 |
commit | 21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch) | |
tree | 84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /runtime/ftplugin/pod.vim | |
parent | d9c904f85a23a496df4eb6be42aa43f007b22d50 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-colorcolchar.tar.gz rneovim-colorcolchar.tar.bz2 rneovim-colorcolchar.zip |
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'runtime/ftplugin/pod.vim')
-rw-r--r-- | runtime/ftplugin/pod.vim | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/runtime/ftplugin/pod.vim b/runtime/ftplugin/pod.vim index 2a905ab354..61a4aa094a 100644 --- a/runtime/ftplugin/pod.vim +++ b/runtime/ftplugin/pod.vim @@ -5,11 +5,12 @@ " Homepage: https://github.com/vim-perl/vim-perl " Bugs/requests: https://github.com/vim-perl/vim-perl/issues " License: Vim License (see :help license) -" Last Change: 2021 Oct 19 +" Last Change: 2023 Jul 05 if exists("b:did_ftplugin") - finish + finish endif +let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo-=C @@ -37,12 +38,12 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin .= " | unlet! b:browsefilter" endif -function! s:jumpToSection(backwards) - let flags = a:backwards ? 'bsWz' : 'sWz' - if has('syntax_items') +function s:jumpToSection(direction) + let flags = a:direction == "backward" ? "bsWz" : "sWz" + if has("syntax_items") let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# '\\<podCommand\\>'" else - let skip = '' + let skip = "" endif for i in range(v:count1) call search('^=\a', flags, 0, 0, skip) @@ -50,19 +51,17 @@ function! s:jumpToSection(backwards) endfunction if !exists("no_plugin_maps") && !exists("no_pod_maps") - nnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR> - vnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR> - nnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR> - vnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR> - nnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR> - vnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR> - nnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR> - vnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR> - let b:undo_ftplugin .= - \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" . - \ " | silent! exe 'nunmap <buffer> ][' | silent! exe 'vunmap <buffer> ]['" . - \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" . - \ " | silent! exe 'nunmap <buffer> []' | silent! exe 'vunmap <buffer> []'" + for s:mode in ["n", "o", "x"] + for s:lhs in ["]]", "]["] + execute s:mode . "noremap <silent> <buffer> " . s:lhs . " <Cmd>call <SID>jumpToSection('forward')<CR>" + let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap <buffer> " . s:lhs . "'" + endfor + for s:lhs in ["[[", "[]"] + execute s:mode . "noremap <silent> <buffer> " . s:lhs . " <Cmd>call <SID>jumpToSection('backward')<CR>" + let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap <buffer> " . s:lhs . "'" + endfor + endfor + unlet s:mode s:lhs endif let &cpo = s:save_cpo |