Dup Goto 📝

VimFunctions

PT2/editor/vim/vimscript 11-14 09:26:59
To Pop
22 lines, 38 words, 392 chars Tuesday 2023-11-14 09:26:59

Defining functions

function CommentLine()
  :s@.*@<!--&-->@
endfunction
function UnCommentLine()
  :s@<!--\(.*\)-->@\1@
endfunction 

Calling functions

call CommentLine()

Mapping Functions

nnoremap \kc :call CommentLine()<cr>
vnoremap \kc :call CommentLine()<cr>