vim mode comment block not working

All the usual vim tricks I know are unusable in Rstudio when vim keybindings are active.

The most used is:
V (visual mode)
Cursor (move to mark text)
Shift + i (insert mode)
insert comment #
Esc Esc

The issues is annoying as the usual Shift + Ctrl + C does no work at all in vim mode.

The following three methods work for me to mark blocks of code as comments in the code pane of R Studio.

  1. While in insert mode, use Shift + Arrow to select text then Shift + Control + C to make every line that has text selected on it a comment.
  2. Starting from normal mode, press Shift + V to enter visual mode with line selection. Use the arrows to select lines then Shift + Control + C to mark the lines as comments.
  3. In normal mode, use Shift + Arrow to select text then Shift + Control + C to make every line that has text selected on it a comment.

I am using RStudio 1.3.1093

All your suggestions use the rstudio keys for commenting, as I wrote, that key combo does not work in my case, so that is why I asked for the vim way.

I wrote my response to show that Shift + Control + C does work on my system, thinking that it could be made to work on your system.
In any case, I can use Shift + V and then the arrow keys to select lines. Typing : then activates command mode and the command line shows '<,'> . If I type s/^/#/ and press Enter, all of the selected lines become comments.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.