tcomment_vim
tcomment_vim copied to clipboard
Command to insert a comment on the line above a text object
It would be useful if there were functionality for commenting on the line above a text object. I would use this for paragraphs, methods, etc.
I wrote the below function to implement this, but it does not handle edge cases well and surely does not integrate well into the TComment codebase:
function! CommentAboveOperator(type)
'[
exec "normal! O" . substitute(&commentstring, "%s", "", "") . " "
startinsert!
endfunction