tcomment_vim icon indicating copy to clipboard operation
tcomment_vim copied to clipboard

Command to insert a comment on the line above a text object

Open smackesey opened this issue 11 years ago • 1 comments

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.

smackesey avatar Apr 13 '14 23:04 smackesey

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

smackesey avatar Apr 13 '14 23:04 smackesey