Skip to content

Instantly share code, notes, and snippets.

@lukesmurray
Created September 29, 2021 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukesmurray/0fc0d45dc1f48820fe537b0e2166a4a2 to your computer and use it in GitHub Desktop.
Save lukesmurray/0fc0d45dc1f48820fe537b0e2166a4a2 to your computer and use it in GitHub Desktop.
vim settings for vscode
"vim.normalModeKeyBindingsNonRecursive": [
// use ctrl-hjkl to navigate splits instead of (ctrl+w + h)
{
"after": ["<C-w>", "h"],
"before": ["<C-h>"]
},
{
"after": ["<C-w>", "j"],
"before": ["<C-j>"]
},
{
"after": ["<C-w>", "k"],
"before": ["<C-k>"]
},
{
"after": ["<C-w>", "l"],
"before": ["<C-l>"]
},
// view all references with gr
{
"commands": ["references-view.find"],
"before": ["g", "r"]
},
// view all references inline with gR
{
"commands": ["editor.action.referenceSearch.trigger"],
"before": ["g", "R"]
},
// open definition to the right with gs
{
"commands": ["editor.action.revealDefinitionAside"],
"before": ["g", "s"]
},
// open definition to the bottom with gS
{
"commands": [
"editor.action.revealDefinitionAside",
"workbench.action.moveEditorToLeftGroup",
"workbench.action.moveEditorToBelowGroup"
],
"before": ["g", "S"]
},
// view definition inline with gD
{
"commands": ["editor.action.peekDefinition"],
"before": ["g", "D"]
},
// open url with gx
{
"commands": ["editor.action.openLink"],
"before": ["g", "x"]
},
// navigate up and down visually rather than by line with jk
{
"after": ["g", "j"],
"before": ["j"]
},
{
"after": ["g", "k"],
"before": ["k"]
}
],
// copy and paste using the normal clipboard
"vim.useSystemClipboard": true,
"vim.visualModeKeyBindingsNonRecursive": [
// when pasting in visual mode preserve the clipboard don't yank the highlighted text
{
"after": ["p", "g", "v", "y"],
"before": ["p"]
},
// indent in visual mode with shift+. and shift+,
{
"commands": ["editor.action.indentLines"],
"before": [">"]
},
{
"commands": ["editor.action.outdentLines"],
"before": ["<"]
},
// navigate visually rather than by line with jk in visual mode
{
"after": ["g", "j"],
"before": ["j"]
},
{
"after": ["g", "k"],
"before": ["k"]
}
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment