kommentary
kommentary copied to clipboard
Feature request: mapping to append comment to current line
NERDCommenter has the ability to append a comment to the current line, which I find really useful.
The default mapping is <leader>cA
and it appends comment delimiter(s) to the end of the line and leave you in insert mode so you can start typing your comment.
I would love it if this feature were available in kommentary.
Agree that this would be nice to have, for the moment I implemented it myself:
function! AppendComment()
let commentChar = split(&commentstring, '%s')[0]
execute 'normal! A ' . commentChar . ' '
startinsert!
endfunction
nnoremap <silent> <leader>C :call AppendComment()<CR>
Hi, thanks for your interest in kommentary, unfortunately I'll not be adding any new features, I'm sorry I never got to this issue.
If anybody is still interested in this, you can achieve this by defining a custom function, see https://github.com/b3nj5m1n/kommentary#advanced-configuration.