4

This is already on the site, but it doesn't work for me. I'm not 100% sure the answer is responsive to my situation (the question asks about vim "mode"). If it is, the context for the accepted answer isn't obvious for me.

I assume were supposed to splice the JSON fragment

{
  "key": "shift+tab",
  "command": "outdent",
  "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
}

into our settings but it's not clear how or where. The app has a settings.json, a keybindings.json and the plugin has package.json.

I got this to work in vim itself a year or so ago IIRC, but it took a plugin and a couple of settings.

Edit to add: ctrl+[ and ctrl+] aren't functional for me. Presumably they would be w/o the vim plugin, but the plugin overrides the ctrl commands.

mokagio
  • 16,391
  • 3
  • 51
  • 58
Koz
  • 41
  • 1
  • 2

3 Answers3

6

Just as in normal vim, typing >> and << in normal mode or > and < in visual mode will indent and un-indent lines, respectively.

Source: https://vim.fandom.com/wiki/Shifting_blocks_visually

Also: https://stackoverflow.com/a/235841/7007605

Billy
  • 5,179
  • 2
  • 27
  • 53
0

If you are using the main Vim (VSCodeVim), the standard m>, m<, :m,n>, :m,n< are not supported (see https://github.com/VSCodeVim/Vim/issues/3733).

However, this feature is supported by the Neo Vim VS Extension (asvetliakov.vscode-neovim). Note that if you go this route, you do need to install neovim (>v0.5.0) separately, which you can obtain at https://github.com/neovim/neovim/releases/nightly. Then set the path to the neovim executable/binary in the Neo Vim VS extension settings.

JaBel
  • 1
  • 2
0

I remaped < and > in normal mode to ident lines while using the VSCode commands:

"vim.normalModeKeyBindingsNonRecursive": [
    {
        "before": ["<"],
        "commands" : ["tab"]
    },
    {
        "before": [">"],
        "commands" : ["outdent"]
    }
 ]