question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cmd + / commenting broken when multiple lines were selected

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
iansinnottcommented, Mar 13, 2020

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
1reaction
asvetliakovcommented, Dec 25, 2019

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Commenting multiple lines in DOS batch file - Stack Overflow
First - there are two different cases where we can need multi line comments - in a bracket's context where GOTO cannot be...
Read more >
How do I do comments at a Windows command prompt?
The REM command only remarks (i.e. Say something as a comment) the line from being executed. However ...
Read more >
Bulk comment / uncomment is broken in certain cases #19868
The problem here is if you press cmd + / again, it actually adds extra inline comments instead of removing the code block...
Read more >
Comment Shortcut Not Working - Visual Studio Feedback
When attempting to comment out a line of code, using CTRL + '/' , about 20 clicks of the Slash are required to...
Read more >
How to: Break and Combine Statements in Code - Visual Basic
To break a single statement into multiple lines ... terminating all but the last line. VB Copy. cmd.CommandText = _ "SELECT * FROM...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found