a <object> | Select around textobject |
i <object> | Select inside textobject |
Window mode
Press Ctrl-w
in normal mode
Key | Desc. |
---|
w , Ctrl-w | Switch to next window |
v , Ctrl-v | Vertical right split |
s , Ctrl-s | Horizontal bottom split |
f | Go to files in the selections in horizontal splits |
F | Go to files in the selections in vertical splits |
h , Ctrl-h , Left | Move to left split |
j , Ctrl-j , Down | Move to split below |
k , Ctrl-k , Up | Move to split above |
l , Ctrl-l , Right | Move to right split |
q , Ctrl-q | Close current window |
o , Ctrl-o | Only keep the current window, closing all the others |
H | Swap window to the left |
J | Swap window downwards |
K | Swap window upwards |
L | Swap window to the right |
Space mode
Press Space
in normal mode
Key | Desc. |
---|
f | Open file picker |
F | Open file picker at current working directory |
b | Open buffer picker |
j | Open jumplist picker |
k | Show documentation for item under cursor in a popup (LSP) |
s | Open document symbol picker (LSP) |
S | Open workspace symbol picker (LSP) |
d | Open document diagnostics picker (LSP) |
D | Open workspace diagnostics picker (LSP) |
r | Rename symbol (LSP) |
a | Apply code action (LSP) |
h | Select symbol references (LSP) |
c | Comment/uncomment selections |
/ | Global search in workspace folder |
? | Open command palette |
Unimpaired
Key | Desc. |
---|
]d | Go to next diagnostic (LSP) |
[d | Go to previous diagnostic (LSP) |
]D | Go to last diagnostic in document (LSP) |
[D | Go to first diagnostic in document (LSP) |
]f | Go to next function (TS) |
[f | Go to previous function (TS) |
]t | Go to next type definition (TS) |
[t | Go to previous type definition (TS) |
]a | Go to next argument/parameter (TS) |
[a | Go to previous argument/parameter (TS) |
]c | Go to next comment (TS) |
[c | Go to previous comment (TS) |
]T | Go to next test (TS) |
[T | Go to previous test (TS) |
]p | Go to next paragraph |
[p | Go to previous paragraph |
Editors
I current use vscode for its light-weight and extensions. I use the extension Dance - Helix Alpha and EasyMotion to simulate Helix's key bindings.
Also, I add some key bindings:
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "Escape",
"command": "dance.modes.set.normal",
"when": "editorTextFocus"
},
{
"key": "ctrl+w",
"command": "vscode-easymotion.jumpToWord",
"when": "editorTextFocus && dance.mode == 'insert'"
},
{
"key": "=",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && dance.mode == 'normal'"
},
{
"key": "Ctrl+[",
"command": "workbench.action.navigateBack",
"when": "editorTextFocus && dance.mode == 'normal'"
},
{
"key": "Ctrl+]",
"command": "workbench.action.navigateForward",
"when": "editorTextFocus && dance.mode == 'normal'"
}
]
When using Vscode Vim plugin, I include the following settings:
{
"vim.easymotion": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
},
{
"before": ["<C-j>"],
"commands": [
"cursorDown"
]
},
{
"before": ["C-k"],
"commands": ["cursorUp"]
},
{
"before": ["C-h"],
"commands": ["cursorLeft"]
},
{
"before": ["<C-l>"],
"commands": ["cursorRight"]
}
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "d"],
"after": ["d", "d"]
},
{
"before": ["<C-n>"],
"commands": [":nohl"]
},
{
"before": ["K"],
"commands": ["lineBreakInsert"],
"silent": true
}
],
"vim.leader": "<space>",
"vim.handleKeys": {
"<C-a>": false,
"<C-e>": false,
"<C-f>": false
},
"vim.smartRelativeLine": true,
"vim.cursorStylePerMode.insert": "line-thin",
"vim.cursorStylePerMode.normal": "block",
"vim.normalModeKeyBindings": [
{
"before" : ["<leader>","w"],
"commands" : [
"workbench.action.switchWindow",
]
},
{
"before" : ["<leader>","s"],
"commands" : [
"workbench.action.showAllSymbols",
]
},
{
"before" : ["<leader>","f"],
"commands" : [
"workbench.action.quickOpen",
]
},
{
"before" : ["<leader>","r"],
"commands" : [
"workbench.action.openRecent",
]
},
{
"before" : ["<leader>","a"],
"commands" : [
"editor.action.quickFix",
]
},
{
"before": ["<leader>", "p"],
"commands": [
"workbench.action.showCommands"
]
},
{
"before": ["g", "r"],
"commands": [
"editor.action.goToReferences"
]
},
{
"before": ["g", "i"],
"commands": [
"editor.action.goToImplementation"
]
}
],
}