I am using a vim plugin called tComment
It allows me to comment a line by pressing gc
or <c-_><c-_>
Also, it works on the shortcut <c-/><c-/>
but the visual selection
is lost.
So, I tried:
- To make it work on single
<c-/>
- To retain the visual selection.
My attempts :
inoremap <c-/> gc
vnoremap <c-/> gc gv
nnoremap <c-/> gc
=========
imap <c-/> gc
vmap <c-/> gc gv
nmap <c-/> gc
=========
imap <c-/> gc$
vmap <c-/> gc$ gv
nmap <c-/> gc$
=========
inoremap <c-/> <c-_><c-_>
vnoremap <c-/> <c-_><c-_> gv
nnoremap <c-/> <c-_><c-_>
=========
imap <c-/> <c-_><c-_>
vmap <c-/> <c-_><c-_> gv
nmap <c-/> <c-_><c-_>
( Non of the above seems to work )
Note:
- I have not done any other customizations from my side.
- My attempts are listed above
- Installing
tComment
on nativevim
(Ubuntu) lands you to my setup.