Vscode-neovim: cmd + / commenting broken when multiple lines were selected

Created on 25 Dec 2019  路  3Comments  路  Source: asvetliakov/vscode-neovim

As the title says, after last update when multiple line were selected using V, only the line with cursor will be commented using cmd + /, although gc doesn't have this issue, I can't set my vim-commentary to work correctly on jsx/tsx files.

v0.0.44

question

All 3 comments

visual mode don't produce visual selections from 0.0.43,see changelog.

although gc doesn't have this issue

My recommendation is to use gc, or use own binding and convert visual mode to selection before calling the command

I can't set my vim-commentary to work correctly on jsx/tsx files.

If you're trying to set local binding through autocmd FileType this doesn't work, but fixed in latest master ( #115 )

Also setting

nmap <C-/> <Plug>VSCodeCommentaryLine
xmap <C-/> <Plug>VSCodeCommentary

should bring you the correct behavior too (in case if you overwrote <C-/> with custom bindings)

The above solution didn't work for me unfortunately didn't work for me, but I was able to get CMD+/ working for multiline commenting doing the following. Maybe it will help anyone else who comes across this issue.

Pass through CMD+/ key to neovim:

// keybindings.json
  {
    "command": "vscode-neovim.send",
    "key": "cmd+/",
    "when": "editorTextFocus && neovim.mode != insert",
    "args": "<D-/>"
  },

Use the gc mappings as mentioned elsewhere. Then map the command keys to the gc mappings (recursively!).

" init.vim
xmap gc  <Plug>VSCodeCommentary
nmap gc  <Plug>VSCodeCommentary
omap gc  <Plug>VSCodeCommentary
nmap gcc <Plug>VSCodeCommentaryLine

nmap <D-/> gcc
xmap <D-/> gc
Was this page helpful?
0 / 5 - 0 ratings

Related issues

asvetliakov picture asvetliakov  路  5Comments

zeljkofilipin picture zeljkofilipin  路  3Comments

joshua7v picture joshua7v  路  4Comments

DrakeXiang picture DrakeXiang  路  5Comments

iansinnott picture iansinnott  路  4Comments