Improved comment function for multiline selection
This commit is contained in:
@@ -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>'
|
||||
|
||||
Reference in New Issue
Block a user