Sun, 19 Feb 2023 13:03:57 -0600
Copy other ft and plugin settings
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/asciidoc.vim @@ -0,0 +1,1 @@ +runtime ftplugin/text.vim
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/crontab.vim @@ -0,0 +1,1 @@ +setl backupcopy=yes
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/gitcommit.vim @@ -0,0 +1,1 @@ +setl noswapfile noundofile nobackup
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/gitconfig.vim @@ -0,0 +1,1 @@ +set noet sw=8
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/gitrebase.vim @@ -0,0 +1,1 @@ +setl noswapfile noundofile nobackup
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/go.vim @@ -0,0 +1,1 @@ +set noet ts=8 sw=8
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/hgcommit.vim @@ -0,0 +1,1 @@ +setl noswapfile noundofile nobackup
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/lua.vim @@ -0,0 +1,1 @@ +setl et sw=2
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/mail.vim @@ -0,0 +1,40 @@ +setl textwidth=72 +setl formatoptions=jaw12tcql +setl spell +setl noundofile noswapfile nobackup + +setl equalprg=pandoc\ -f\ markdown\ -t\ markdown + +" http://cedricduval.free.fr/download/mail.vim +function! Mail_Erase_Sig() + " search for the signature pattern (takes into account signature delimiters + " from broken mailers that forget the space after the two dashes) + let i = 0 + while ((i <= line('$')) && (getline(i) !~ '^> *-- \=$')) + let i = i + 1 + endwhile + + " if found, then + if (i != line('$') + 1) + " first, look for our own signature, to avoid deleting it + let j = i + while (j < line('$') && (getline(j + 1) !~ '^-- $')) + let j = j + 1 + endwhile + + " second, search for the last non empty (non sig) line + while ((i > 0) && (getline(i - 1) =~ '^\(>\s*\)*$')) + let i = i - 1 + endwhile + + " third, delete those lines plus the signature + exe ':'.i.','.(j - 1).'d' + endif +endfunction + +call Mail_Erase_Sig() + +" Get right to composing the body: +if line('$') > 1 && line("'\"") < 1 + :normal gg} +endif
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/markdown.vim @@ -0,0 +1,17 @@ +runtime ftplugin/text.vim +setl equalprg=pandoc\ -f\ markdown\ -t\ markdown + +if !exists('b:markdown_autohtml') + let b:markdown_autohtml = 0 +endif + +function! s:autohtml() abort + if get(b:, 'markdown_autohtml', 0) + silent !md2html -o "%:p.html" "%:p" + endif +endfunction + +augroup Markdown + autocmd! + autocmd BufWritePost <buffer> call s:autohtml() +augroup END
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/netrw.vim @@ -0,0 +1,1 @@ +nnoremap <buffer> gb <C-^>
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/perl.vim @@ -0,0 +1,2 @@ +compiler perl +setl equalprg=perltidy\ -q
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/pod.vim @@ -0,0 +1,1 @@ +runtime ftplugin/text.vim
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/sh.vim @@ -0,0 +1,1 @@ +let &l:equalprg = "shfmt -i " . &shiftwidth
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/sql.vim @@ -0,0 +1,12 @@ +" mjibson/sqlfmt - only does cockroachdb dialect +" this kinda sucks as far as placeholders and can't pass through odd syntax + +" let &l:equalprg = "sqlfmt --use-spaces --tab-width " . &shiftwidth +" augroup SQLFMT_ERR +" au! * <buffer> +" autocmd ShellFilterPost <buffer> if v:shell_error | undo | endif +" augroup END + +" cpanm https://github.com/darold/pgFormatter.git +let &l:equalprg = "pg_format -" +let &l:omnifunc = "syntaxcomplete#Complete"
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/text.vim @@ -0,0 +1,2 @@ +setl textwidth=72 +setl formatoptions+=at12
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/ftplugin/vimwiki.vim @@ -0,0 +1,1 @@ +set nowrap
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/plugin/tabular.vim @@ -0,0 +1,7 @@ +if exists(':Tabularize') + AddTabularPattern! first_eq /^.\{-}\zs=/ + AddTabularPattern! first_arrow /^.\{-}\zs=>/ + AddTabularPattern! first_colon /^.\{-}:\zs/l0l1 + AddTabularPattern! comma /,\zs/l0l1 + AddTabularPattern! methods /^.\{-}\zs\(->\|\.\)/l0 +endif
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/plugin/tagbar.vim @@ -0,0 +1,98 @@ +" adapted from https://gist.github.com/jbolila/7598018 +let g:tagbar_type_perl = { + \ 'ctagstype' : 'Perl', + \ 'kinds' : [ + \ 'p:packages:1:0', + \ 'u:uses:1:0', + \ 'r:requires:1:0', + \ 'e:extends', + \ 'w:roles', + \ 'o:ours:1:0', + \ 'c:constants:1:0', + \ 'f:formats:1:0', + \ 'a:attributes', + \ 'm:methods', + \ 's:subroutines', + \ 'x:modifier', + \ 'l:aliases', + \ 'd:pod:1:0', + \ ], + \ 'deffile' : stdpath("config") . '/tagbar/perl.cnf' +\ } + +let g:tagbar_type_elixir = { + \ 'ctagstype' : 'Elixir', + \ 'kinds' : [ + \ 'm:modules:1:0', + \ 'r:records', + \ 'f:functions', + \ 'a:macros', + \ 'o:operators', + \ 'p:protocols', + \ 'i:implementations', + \ 'd:delegates', + \ 'c:callbacks', + \ 'e:exceptions', + \ ], +\ } + +" https://github.com/jstemmer/gotags +let g:tagbar_type_go = { + \ 'ctagstype' : 'go', + \ 'kinds' : [ + \ 'p:package', + \ 'i:imports:1', + \ 'c:constants', + \ 'v:variables', + \ 't:types', + \ 'n:interfaces', + \ 'w:fields', + \ 'e:embedded', + \ 'm:methods', + \ 'r:constructor', + \ 'f:functions' + \ ], + \ 'sro' : '.', + \ 'kind2scope' : { + \ 't' : 'ctype', + \ 'n' : 'ntype' + \ }, + \ 'scope2kind' : { + \ 'ctype' : 't', + \ 'ntype' : 'n' + \ }, + \ 'ctagsbin' : 'gotags', + \ 'ctagsargs' : '-sort -silent' +\ } + +" https://github.com/wsdjeg/mdctags.rs +let g:tagbar_type_markdown = { + \ 'ctagsbin' : 'mdctags', + \ 'ctagsargs' : '', + \ 'sort' : 0, + \ 'kinds' : [ + \ 'a:h1:0:0', + \ 'b:h2:0:0', + \ 'c:h3:0:0', + \ 'd:h4:0:0', + \ 'e:h5:0:0', + \ 'f:h6:0:0', + \ ], + \ 'sro' : '::', + \ 'kind2scope' : { + \ 'a' : 'h1', + \ 'b' : 'h2', + \ 'c' : 'h3', + \ 'd' : 'h4', + \ 'e' : 'h5', + \ 'f' : 'h6', + \ }, + \ 'scope2kind' : { + \ 'h1' : 'a', + \ 'h2' : 'b', + \ 'h3' : 'c', + \ 'h4' : 'd', + \ 'h5' : 'e', + \ 'h6' : 'f', + \} +\}
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/syntax/perl/contrib.vim @@ -0,0 +1,11 @@ + +" Contrib files from vim-perl/vim-perl +" I would use symlinks but cygwin likes to fumble them +runtime contrib/carp.vim +runtime contrib/highlight-all-pragmas.vim +runtime contrib/moose.vim +" runtime contrib/function-parameters.vim +runtime contrib/test-more.vim +runtime contrib/try-tiny.vim +runtime contrib/heredoc-sql.vim +
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/syntax/perl/custom.vim @@ -0,0 +1,29 @@ +" this keeps indents from jumping more than one level +let b:indent_use_syntax = 0 + +syn sync minlines=1500 + +" Weird behavior in sql heredocs +syn clear sqlFold + +" fix highlight-all-pragma for vN.NN +syn match perlStatementInclude "\<\%(use\|no\)\s\+v\(\d\|.\)\+" + +" Add match for =method and =func from Pod::Weaver +syn match podCommand "^=method" contained nextgroup=podCmdText contains=@NoSpell +syn match podCommand "^=func" contained nextgroup=podCmdText contains=@NoSpell + +" Add matches for contrib/function-parameters.vim, but don't apply to fat-arrow cases +syn match perlFunction +\<method\>\(\_s*=>\)\@!\_s*+ nextgroup=perlSubName +syn match perlFunction +\<fun\>\(\_s*=>\)\@!\_s*+ nextgroup=perlSubName + +" Tweak some colors, making POD stand out less +hi! def link perlPOD Comment +hi! def link podOrdinary Comment +hi! def link podCommand SpecialComment +hi! def link podCmdText Question +hi! def link podFormat StorageClass + +syntax region perlHereDocSQL matchgroup=perlStringStartEnd start=+<<\~\s*'\z(\%(END_\)\=SQL\)'+ end='^\s*\z1$' contains=@SQL +syntax region perlHereDocSQL matchgroup=perlStringStartEnd start='<<\~\s*"\z(\%(END_\)\=SQL\)"' end='^\s*\z1$' contains=@perlInterpDQ,@SQL +syntax region perlHereDocSQL matchgroup=perlStringStartEnd start='<<\~\s*\z(\%(END_\)\=SQL\)' end='^\s*\z1$' contains=@perlInterpDQ,@SQL
new file mode 100644 --- /dev/null +++ b/.config/nvim/after/syntax/sh/pod.vim @@ -0,0 +1,12 @@ +let s:current_syntax = b:current_syntax +unlet b:current_syntax +syn include @Pod syntax/pod.vim +syn region shPOD start="^=pod" start="^=head" end="^=cut" keepend contained contains=@Pod +let b:current_syntax = s:current_syntax + +syn region shPODHeredoc start="^:<<=cut" end="^=cut" keepend contains=shPOD + +hi! def link shPOD Comment +hi! def link podCommand SpecialComment +hi! def link podCmdText Question +hi! def link podFormat StorageClass
--- a/.config/nvim/lua/plugins/editing.lua +++ b/.config/nvim/lua/plugins/editing.lua @@ -18,7 +18,7 @@ return { "tpope/vim-unimpaired", "tomtom/tcomment_vim", "tpope/vim-endwise", - {"godlygeek/tabular", cmd = "Tabularize"}, + "godlygeek/tabular", {"mbbill/undotree", cmd = "UndotreeToggle"}, "tpope/vim-vinegar",
new file mode 100644 --- /dev/null +++ b/.config/nvim/tagbar/perl.cnf @@ -0,0 +1,11 @@ +--langmap=perl:+.pod +--regex-perl=/^\s*\*([A-Za-z_][A-Za-z0-9:_]+)[ \t]+=/\1/l,alias,aliases/ +--regex-perl=/^\s*our[ \t]+([\$@%][A-Za-z_][A-Za-z0-9_]+)/\1/o,our,ours/ +--regex-perl=/^\s*use[ \t]+constant[ \t]+['"]*([A-Za-z_][A-Za-z0-9_]+)['" \t]*/\1/c,constants/ +--regex-perl=/^\s*with[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/w,role,roles/ +--regex-perl=/^\s*extends[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/e,extends/ +--regex-perl=/^\s*use[ \t]+base[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/e,extends/ +--regex-perl=/^\s*use[ \t]+parent[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/e,extends/ +--regex-perl=/^\s*use[ \t]+Mojo::Base[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/e,extends/ +--regex-perl=/^\s*use[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*/\1/u,use,uses/ +--regex-perl=/^\s*require[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/r,require,requires/