Improved comment function for multiline selection

This commit is contained in:
Nathan Schneider
2025-08-13 16:41:55 -06:00
parent 012e5cc22b
commit a5091fe2b2
+8 -1
View File
@@ -34,7 +34,14 @@ set shell=bash\ -l
" Shortcuts
command! Proximate :e ~/Cloud/Notes/Proximate.md
command! W :w|b#|bd#
command! -range Comment <line1>,<line2>s/\%V.*\%V./<!---\r&\r--->/
command! -range Comment call CommentWrap(<line1>, <line2>)
function! CommentWrap(start, end)
" Insert closing comment after the last line
call append(a:end, '--->')
" Insert opening comment before the first line
call append(a:start - 1, '<!---')
endfunction
" Create panda command for pandout
command! -nargs=1 Panda execute ':w' | execute ':!~/.scripts/panda.sh % <args>'