robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
db210dd2a4
master
1" Vim filetype plugin file 2" Language: Perl POD format 3" Maintainer: vim-perl <vim-perl@googlegroups.com> (need to be subscribed to post) 4" Author: Doug Kearns <dougkearns@gmail.com> 5" Homepage: https://github.com/vim-perl/vim-perl 6" Bugs/requests: https://github.com/vim-perl/vim-perl/issues 7" License: Vim License (see :help license) 8" Last Change: 2023 Jul 05 9" Last Change: 2021 Oct 19 10" 2024 Jan 14 by Vim Project (browsefilter) 11 12if exists ( "b:did_ftplugin" ) 13finish 14endif 15let b: did_ftplugin = 1 16 17let s: save_cpo = & cpo 18set cpo -= C 19 20setlocal comments = fb:=for\ comment 21setlocal commentstring = =for\ comment\ %s 22 23let b: undo_ftplugin = "setl com< cms<" 24 25if exists ( "loaded_matchit" ) && ! exists ( "b:match_words" ) 26let b: match_words = 27 \'^=pod\>:^=cut\>,' . 28 \'^=begin\s\+\(\S\+\):^=end\s\+\1,' . 29 \'^=over\>:^=item\>:^=back\>,' . 30 \'[IBCLEFSXZ]<<\%(\s\+\|$\)\@=:\%(\s\+\|^\)\@<=>>,' . 31 \'[IBCLEFSXZ]<:>' 32let b: undo_ftplugin .= " | unlet! b:match_words" 33endif 34 35if ( has ( "gui_win32" ) || has ( "gui_gtk" )) && ! exists ( "b:browsefilter" ) 36let b: browsefilter = "POD Source Files (*.pod)\t*.pod\n" . 37 \"Perl Source Files (*.pl)\t*.pl\n" . 38 \"Perl Modules (*.pm)\t*.pm\n" 39if has ( "win32" ) 40let b: browsefilter .= "All Files (*.*)\t*\n" 41else 42let b: browsefilter .= "All Files (*)\t*\n" 43endif 44let b: undo_ftplugin .= " | unlet! b:browsefilter" 45endif 46 47function s: jumpToSection ( direction ) 48let flags = a: direction == "backward" ? "bsWz" : "sWz" 49if has ( "syntax_items" ) 50let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# '\\<podCommand\\>'" 51else 52let skip = "" 53endif 54for i in range ( v: count1 ) 55call search ( '^=\a' , flags , 0 , 0 , skip ) 56endfor 57endfunction 58 59if ! exists ( "no_plugin_maps" ) && ! exists ( "no_pod_maps" ) 60for s: mode in [ "n" , "o" , "x" ] 61for s: lhs in [ "]]" , "][" ] 62execute s: mode . "noremap <silent> <buffer> " . s: lhs . " <Cmd>call <SID>jumpToSection('forward')<CR>" 63let b: undo_ftplugin .= " | silent! execute '" . s: mode . "unmap <buffer> " . s: lhs . "'" 64endfor 65for s: lhs in [ "[[" , "[]" ] 66execute s: mode . "noremap <silent> <buffer> " . s: lhs . " <Cmd>call <SID>jumpToSection('backward')<CR>" 67let b: undo_ftplugin .= " | silent! execute '" . s: mode . "unmap <buffer> " . s: lhs . "'" 68endfor 69endfor 70unlet s: mode s: lhs 71endif 72 73let & cpo = s: save_cpo 74unlet s: save_cpo 75 76" vim: set expandtab: