Files
nvim-config/KEYBINDS.md
Wesley van Tilburg 6dfbb4ec22 fix: multiple navigation fixes for splits/popup terminal
chore: update Keybinds.md

more navigation fixes (primarly disabling mouse when terminal is open)

rm session
2026-03-14 13:56:36 +01:00

167 lines
4.5 KiB
Markdown

# Neovim Keybinds & Commands Cheatsheet
## LSP
| Key | Action |
|-----|--------|
| `gd` | Go to definition (reuses existing split) |
| `gD` | Go to declaration |
| `gi` | Go to implementation |
| `gr` | Go to references |
| `gt` | Go to type definition |
| `K` | Hover documentation |
| `<C-k>` | Signature help (normal + insert) |
| `<leader>ca` | Code action |
| `<leader>rn` | Rename symbol |
| `<leader>f` | Format file |
## Diagnostics
| Key | Action |
|-----|--------|
| `[d` | Previous diagnostic |
| `]d` | Next diagnostic |
| `gl` | Open diagnostic float |
| `<leader>q` | Buffer diagnostics to loclist |
Go files auto-format and organize imports on save.
## Autocompletion (blink.cmp)
| Key | Action |
|-----|--------|
| `<C-space>` | Trigger completion menu |
| `<C-n>` | Next item |
| `<C-p>` | Previous item |
| `<CR>` | Confirm selection |
| `<C-e>` | Dismiss menu |
| `<C-b>` | Scroll docs up |
| `<C-f>` | Scroll docs down |
Sources: LSP, buffer words, file paths.
## Pane Navigation
| Key | Action |
|-----|--------|
| `<Alt-h>` | Move left (or prev terminal tab in popup) |
| `<Alt-l>` | Move right (or next terminal tab in popup) |
| `<Alt-j>` | Move down |
| `<Alt-k>` | Move up |
Navigation wraps around (left from leftmost goes to rightmost).
Alt+h/l switch terminal tabs when the popup terminal is open.
## Buffer Tabs (per-split)
| Key | Action |
|-----|--------|
| `<Tab>` | Next buffer in current split |
| `<Shift-Tab>` | Previous buffer in current split |
| `<leader>x` | Close current buffer |
| `:q` | Close current buffer (keeps split) |
| `:wq` | Save and close current buffer |
Each file belongs to one split only. Selecting an already-open file from oil focuses its split.
## File Explorer (oil.nvim)
| Key / Command | Action |
|---------------|--------|
| `<leader>e` | Toggle file tree (left sidebar) |
| `-` or `<BS>` | Go up one directory |
| `<CR>` | Open file in last used code split |
| `<leader>d` | Delete file/directory under cursor |
| `g.` | Toggle hidden files |
| `<C-p>` | Preview file |
| `<C-c>` | Close oil |
| `:w` (in oil buffer) | Save filesystem changes (renames, moves, etc.) |
File tree opens automatically on startup. Edit filenames directly in the buffer, then `:w` to apply.
## Popup Terminal
| Key | Action |
|-----|--------|
| `<C-t>` | Toggle popup terminal |
| `<Alt-h>` | Previous terminal tab |
| `<Alt-l>` | Next terminal tab |
| `<C-n>` | New terminal tab |
| `<C-w>` | Close terminal tab |
| `<C-v>` | Paste from clipboard |
| `<Esc>` | Exit to normal mode |
Terminal session persists when hidden. Tab indicator in title: `Terminal [1] 2 3`.
## Task Runner (overseer.nvim)
| Command | Action |
|---------|--------|
| `:OverseerRun` | Pick and run a task |
| `:OverseerToggle` | Toggle task list panel |
| `:OverseerInfo` | Show overseer status/info |
| `:OverseerBuild` | Build a task from scratch |
| `:OverseerQuickAction` | Run quick action on recent task |
| `:OverseerTaskAction` | Pick a task, then an action |
| `:OverseerClearCache` | Clear cached tasks |
Tasks integrate with quickfix: errors populate the quickfix list.
## Mason (LSP server management)
| Command | Action |
|---------|--------|
| `:Mason` | Open Mason UI |
| `:MasonInstall <server>` | Install a server |
| `:MasonUninstall <server>` | Remove a server |
| `:MasonUpdate` | Update all servers |
Auto-installed servers: `gopls`, `bashls`, `ansiblels`, `yamlls`.
## Treesitter
| Command | Action |
|---------|--------|
| `:TSInstall <lang>` | Install a parser |
| `:TSUpdate` | Update all parsers |
| `:TSInstall go bash yaml lua` | Install all configured parsers |
Syntax highlighting is automatic once a parser is installed.
## Quickfix List (built-in)
| Key / Command | Action |
|---------------|--------|
| `:copen` | Open quickfix window |
| `:cclose` | Close quickfix window |
| `:cnext` / `]q` | Next quickfix item |
| `:cprev` / `[q` | Previous quickfix item |
## Window Management
| Key | Action |
|-----|--------|
| `<C-w>v` | Vertical split |
| `<C-w>s` | Horizontal split |
| `<C-w>>` | Wider |
| `<C-w><` | Narrower |
| `<C-w>+` | Taller |
| `<C-w>-` | Shorter |
| `<C-w>=` | Equal size all |
| `10<C-w>>` | Wider by 10 columns |
Splitting from oil auto-redirects to the code area.
## Sessions / Layout
| Key | Action |
|-----|--------|
| `<leader>ss` | Save current layout/session |
| `<leader>sl` | Load saved layout/session |
Saves window positions, sizes, buffers, terminals, and current directory.
## Statusline
Shows: `filename [modified] [readonly]` on the left, `git-branch | line:col percent` on the right.