Skip to content

Instantly share code, notes, and snippets.

@AnsonH
Last active July 6, 2024 10:58
Show Gist options
  • Save AnsonH/e6b5222c3f0e588253a3e8fb0d55e147 to your computer and use it in GitHub Desktop.
Save AnsonH/e6b5222c3f0e588253a3e8fb0d55e147 to your computer and use it in GitHub Desktop.
{
"vim.leader": "<space>",
"vim.normalModeKeyBindings": [
// Tabs
{
"before": ["H"], // Focus previous tab at the left
"commands": ["workbench.action.previousEditor"]
},
{
"before": ["L"], // Focus next tab at the right
"commands": ["workbench.action.nextEditor"]
},
{
"before": ["Q"], // Close current tab
"after": ["<C-w>", "q"]
},
// Splits
{
"before": ["|"], // Split tab vertically
"after": ["<C-w>", "v"]
},
{
"before": ["_"], // Split tab horizontally
"after": ["<C-w>", "s"]
},
{
"before": ["<C-h>"], // Focus split window at left
"commands": ["workbench.action.focusLeftGroup"]
},
{
"before": ["<C-j>"], // Focus split window at right
"commands": ["workbench.action.focusBelowGroup"]
},
{
"before": ["<C-k>"], // Focus split window at above
"commands": ["workbench.action.focusAboveGroup"]
},
{
"before": ["<C-l>"], // Focus split window at below
"commands": ["workbench.action.focusRightGroup"]
},
// Quick Search
{
"before": ["<leader>", "f"], // Search text
"commands": ["workbench.action.findInFiles"]
},
{
"before": ["<leader>", "s"], // Search symbol
"commands": ["workbench.action.showAllSymbols"]
},
// Git
{
"before": ["<leader>", "g", "p"], // Peek Git diff for the changed line
"commands": ["editor.action.dirtydiff.next"]
},
{
"before": ["<leader>", "g", "r"], // Revert hunk
"commands": ["git.revertSelectedRanges"]
},
{
"before": ["<leader>", "g", "j"], // Jump to next Git change
"commands": ["workbench.action.editor.nextChange"]
},
{
"before": ["<leader>", "g", "k"], // Jump to previous Git change
"commands": ["workbench.action.editor.previousChange"]
},
{
"before": ["<leader>", "g", "g"], // Open file in GitHub
"commands": ["gitlens.openFileOnRemote"]
}
],
"vim.visualModeKeyBindings": [
// Git
{
"before": ["<leader>", "g", "r"], // Revert hunk
"commands": ["git.revertSelectedRanges"]
},
{
"before": ["<leader>", "g", "g"], // Open file in GitHub
"commands": ["gitlens.openFileOnRemote"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment