Vim: ctrl+m or ctrl+j to insert <enter> with insert mode.

Created on 13 Apr 2017  路  7Comments  路  Source: VSCodeVim/Vim

What did you do?

  1. In setting.json turn on the ctrl keys support with "vim.useCtrlKeys": true
  2. In text editor pressed i to go to insert mode.
  3. pressed ctrl+m or ctrl+j.

What did you expect to happen?

Insert a new line break(\

What happened instead?

Nothing happened.

Technical details:

  • VSCode Version: 1.11.1
  • VsCodeVim Version: 0.16.5
  • OS: windows 10
kinfeature

Most helpful comment

As a vimer.
I use hjkl instead of arrow keys.
I use ctrl+[ instead of <esc>. (and keep index finger on j)
I use ctrl+m instead of <enter>. (just move index finger little bit to m then back to j very quick)
Just because those keys are too far for my little finger.

All 7 comments

okay i mean we can totally add that but i gotta know: why dont you just use enter??

As a vimer.
I use hjkl instead of arrow keys.
I use ctrl+[ instead of <esc>. (and keep index finger on j)
I use ctrl+m instead of <enter>. (just move index finger little bit to m then back to j very quick)
Just because those keys are too far for my little finger.

Can also this behavior apply in '/' and '?' searching?

A workaround is that setting a keybinding <ctrl-m> to inert snippet \n

    {
        "key": "ctrl+m",
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus && !inDebugRepl && vim.mode == 'Insert'",
        "args": {
          "snippet": "\n"
        }
    },
    {
        "key": "ctrl+j",
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus && !inDebugRepl && vim.mode == 'Insert'",
        "args": {
          "snippet": "\n"
        }
    }

However, it still can't use those combination in command line.

Is there a technical reason why this can't be done? From the first sight it's not, since Ctrl-[ works both in command line and in insert mode

Can we resurrect this issue? I've implemented ctrl+m support in a linked pull request

Was this page helpful?
0 / 5 - 0 ratings