Vim: Recursive mapping V key

Created on 28 Oct 2018  路  2Comments  路  Source: VSCodeVim/Vim

Hi.

In VIM I had such mapping: vmap v <Plug>(expand_region_expand)
That trick was allowing me to just tap v several times to first start selection, and then expand it. In that case, to select a word under the cursor it was enough to type vv instead of viw.

I'm trying to implement something similar in VSCode:

  "vim.visualModeKeyBindings": [
    {
      "before": [ "v" ],
      "commands": [ "editor.action.smartSelect.grow" ]
    },
  ]

But pressing v in _Visual Mode_ just leads to exit to _Normal Mode_.

Is there any other a hacky-way to map v in _Visual Mode_?

Most helpful comment

I ended up with:

  "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": [ "v" ],
      "after": [ "v" ]
    }
  ],
  "vim.visualModeKeyBindingsNonRecursive": [
    {
      "before": [ "v" ],
      "after": [ "a", "f" ]
    }
  ]

All 2 comments

3037

2942

1806

I ended up with:

  "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": [ "v" ],
      "after": [ "v" ]
    }
  ],
  "vim.visualModeKeyBindingsNonRecursive": [
    {
      "before": [ "v" ],
      "after": [ "a", "f" ]
    }
  ]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

st-schneider picture st-schneider  路  3Comments

orn688 picture orn688  路  3Comments

cckowin picture cckowin  路  3Comments

typeoneerror picture typeoneerror  路  3Comments

spinningarrow picture spinningarrow  路  3Comments