You don't have to, but you might want to

Written politely 2020-12-01.

Setting up Vim with VsCode

And you may find yourself living in a shotgun shack
And you may find yourself in another part of the world
And you may find yourself behind the wheel of a large automobile
And you may find yourself in a beautiful house, with a beautiful wife
And you may ask yourself, “Well, how do I even exit Vim?”

Follow me...

Get VSCode

If you don’t have VSCode, get it here.

For Windows:

For OSX:

It’s the bees knees!

If you already have it, 🍻. beers

Install this plugin

Once you have installed VSCode, get the vscodevim extension for VsCode from the VSCode Extensions page or from the extensions page in VSCode itself.

Tweak these settings (or not, but you should)

Here is my custom vim settings from the settings.json file in VSCode.

  "vim.cursorStylePerMode.insert": "line",
  "vim.hlsearch": true,
  "vim.leader": "<space>",
  "vim.easymotion": true,
  "vim.smartRelativeLine": true,
  "vim.camelCaseMotion.enable": true,
  "vim.sneak": true,
  "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": ["<leader>", "e"],
      "commands": ["workbench.view.explorer"]
    },
    {
      "before": ["<leader>", "f"],
      "commands": ["workbench.view.search"]
    },
    {
      "before": ["<leader>", "o"],
      "commands": ["workbench.action.quickOpen"]
    },
    {
      "before": ["<leader>", "c"],
      "commands": ["workbench.action.showCommands"]
    },
    {
      "before": ["<leader>", "r"],
      "commands": ["references-view.find"]
    },
    {
      "before": ["<leader>", "v"],
      "commands": ["workbench.action.splitEditor"]
    },
    {
      "before": ["<leader>", "1"],
      "commands": ["workbench.action.openEditorAtIndex1"]
    },
    {
      "before": ["<leader>", "2"],
      "commands": ["workbench.action.openEditorAtIndex2"]
    },
    {
      "before": ["<leader>", "3"],
      "commands": ["workbench.action.openEditorAtIndex3"]
    },
    {
      "before": ["<leader>", "4"],
      "commands": ["workbench.action.openEditorAtIndex4"]
    },
    {
      "before": ["<leader>", "5"],
      "commands": ["workbench.action.openEditorAtIndex5"]
    },
    {
      "before": ["<leader>", "6"],
      "commands": ["workbench.action.openEditorAtIndex6"]
    },
    {
      "before": ["<leader>", "7"],
      "commands": ["workbench.action.openEditorAtIndex7"]
    },
    {
      "before": ["<leader>", "8"],
      "commands": ["workbench.action.openEditorAtIndex8"]
    },
    {
      "before": ["<leader>", "9"],
      "commands": ["workbench.action.openEditorAtIndex9"]
    },
    {
      "before": ["<leader>", "h"],
      "commands": ["workbench.action.previousEditor"]
    },
    {
      "before": ["<leader>", "l"],
      "commands": ["workbench.action.nextEditor"]
    }
  ],

You should set a <leader> key.

Map <esc> to caps lock button.

Now you are ready to use Vim

powerful With a setup like this, you will see soon why Vim is good (and powerful).


Lucas McDaniel

Husband, father, teacher, musician, avid gamer, nature enthusiast, and passionate about the human condition.