⌨️ Keymaps
FtVim comes with a comprehensive set of keymaps designed for efficient editing. The leader key is <Space> by default.
Press <leader> (Space) and wait to see all available keymaps via which-key. <leader>Fk searches every keymap, and :help ftvim-keymaps.txt shows the full list inside Neovim.
General
| Keymap | Mode | Description |
|---|---|---|
<C-s> | Normal/Insert/Visual | Save file |
<Esc> | Normal/Insert | Clear search highlight |
jk | Insert | Exit insert mode (alternative to Esc) |
j / k | Normal/Visual | Move by display line when no count is given |
<leader>K | Normal | Keywordprg (K without LSP) |
<leader>qq | Normal | Quit |
<leader>; | Normal | Dashboard |
The arrow keys are disabled in normal mode and show a reminder to use h, j, k, l.
Window Navigation
| Keymap | Mode | Description |
|---|---|---|
<C-h> | Normal/Terminal | Go to left window |
<C-j> | Normal/Terminal | Go to lower window |
<C-k> | Normal/Terminal | Go to upper window |
<C-l> | Normal/Terminal | Go to right window |
Window Resize
| Keymap | Description |
|---|---|
<C-Up> | Increase window height |
<C-Down> | Decrease window height |
<C-Left> | Decrease window width |
<C-Right> | Increase window width |
Move Lines
| Keymap | Mode | Description |
|---|---|---|
<A-j> | Normal/Insert/Visual | Move line(s) down |
<A-k> | Normal/Insert/Visual | Move line(s) up |
Indenting
| Keymap | Mode | Description |
|---|---|---|
< | Visual | Indent left (stays in visual mode) |
> | Visual | Indent right (stays in visual mode) |
Comments
FtVim uses Neovim's built-in commenting.
| Keymap | Mode | Description |
|---|---|---|
gcc | Normal | Toggle comment on the line |
gc | Normal/Visual | Toggle comment (with a motion or selection) |
<leader>/ | Normal/Visual | Toggle comment |
gco | Normal | Add comment below |
gcO | Normal | Add comment above |
Find (Leader + f)
All find commands use the snacks.nvim picker.
| Keymap | Description |
|---|---|
<leader>ff | Find files |
<leader>fr | Recent files |
<leader>fb | Find buffers |
<leader>fs | Find string (grep) |
<leader>fc | Find string under cursor |
<leader>fh | Find help tags |
<leader>fk | Find keymaps |
<leader>fC | Find commands |
<leader>fH | Find highlights |
<leader>fM | Find man pages |
<leader>fR | Find registers |
<leader>fl | Resume last search |
<leader>fn | New file |
Picker Navigation
When the picker is open:
| Keymap | Description |
|---|---|
<C-j> / <C-n> | Next item |
<C-k> / <C-p> | Previous item |
<CR> | Confirm selection |
<Esc> | Close picker |
Buffers (Leader + b)
| Keymap | Description |
|---|---|
<S-h> / [b | Previous buffer |
<S-l> / ]b | Next buffer |
[B / ]B | Move buffer left/right |
<leader>bb | Previous buffer |
<leader>bn | Next buffer |
<leader>bd | Delete buffer |
<leader>bD | Delete buffer (force) |
<leader>bf | Find buffer |
<leader>bj | Jump to buffer (pick) |
<leader>be | Pick buffer to close |
<leader>bl | Delete buffers to the left |
<leader>br | Delete buffers to the right |
<leader>bo | Delete other buffers |
<leader>bp | Toggle pin |
<leader>bP | Delete non-pinned buffers |
<leader>bs | Sort buffers by directory |
<leader>bL | Sort buffers by language |
<leader>bW | Save without formatting |
Code / LSP (Leader + c)
These keymaps are available when a language server is attached to the buffer:
| Keymap | Description |
|---|---|
gd | Go to definition |
gr | Go to references |
gI | Go to implementation |
gy | Go to type definition |
gD | Go to declaration |
K | Hover documentation |
gK | Signature help |
<leader>ca | Code action (normal and visual) |
<leader>cr | Rename symbol |
<leader>cd | Go to definition |
<leader>ci | Go to implementation |
<leader>ct | Go to type definition |
<leader>cs | Signature help |
<leader>cv | Hover |
<leader>ch | Toggle inlay hints (if the server supports them) |
Always available:
| Keymap | Description |
|---|---|
<leader>cf | Format buffer or selection |
<leader>cm | Open Mason |
]] / [[ | Next/previous reference of the word under cursor |
Completion
| Keymap | Description |
|---|---|
<C-Space> | Show completion / toggle documentation |
<CR> / <C-y> | Accept |
<C-e> | Close the menu |
<Tab> / <C-j> / <C-n> | Next item (<Tab> also jumps to the next snippet field) |
<S-Tab> / <C-k> / <C-p> | Previous item |
<C-f> / <C-b> | Scroll documentation |
Git (Leader + g)
| Keymap | Description |
|---|---|
<leader>gb | Git branches |
<leader>gc | Git commits |
<leader>gC | Git buffer commits |
<leader>go | Git status |
]h / [h | Next/previous hunk |
]H / [H | Last/first hunk |
<leader>ghs | Stage hunk |
<leader>ghr | Reset hunk |
<leader>ghS | Stage buffer |
<leader>ghu | Undo stage hunk |
<leader>ghR | Reset buffer |
<leader>ghp | Preview hunk inline |
<leader>ghb | Blame line |
<leader>ghB | Blame buffer |
<leader>ghd | Diff this |
<leader>ghD | Diff this ~ |
ih | Select hunk (text object) |
Windows (Leader + w)
| Keymap | Description |
|---|---|
<leader>wd | Close window |
<leader>ww | New window |
<leader>wsh | Split horizontal |
<leader>wsv | Split vertical |
Tabs (Leader + Tab)
| Keymap | Description |
|---|---|
<leader><tab><tab> | New tab |
<leader><tab>d | Close tab |
<leader><tab>] | Next tab |
<leader><tab>[ | Previous tab |
<leader><tab>l | Last tab |
<leader><tab>f | First tab |
<leader><tab>o | Close other tabs |
Terminal (Leader + t)
| Keymap | Mode | Description |
|---|---|---|
<C-\> | Normal/Terminal | Toggle floating terminal |
<leader>tf | Normal | Floating terminal |
<leader>th | Normal | Horizontal terminal |
<leader>tv | Normal | Vertical terminal |
Each one is a separate terminal that keeps running while hidden. In terminal mode, use <C-h/j/k/l> to go to other windows.
Explorer
| Keymap | Description |
|---|---|
<leader>e | Toggle file explorer (Neo-tree) |
In Neo-tree:
| Keymap | Description |
|---|---|
l | Open file/expand folder |
h | Close folder |
<Space> | None (disabled to preserve leader) |
Diagnostics (Leader + x)
| Keymap | Description |
|---|---|
<leader>xd | Toggle diagnostics on/off |
<leader>xl | Location list |
<leader>xq | Quickfix list |
[q | Previous quickfix item |
]q | Next quickfix item |
UI and Notifications (Leader + u, Leader + n)
| Keymap | Description |
|---|---|
<leader>uf | Toggle format on save |
<leader>un | Dismiss all notifications |
<leader>nh | Notification history |
Plugins (Leader + p)
| Keymap | Description |
|---|---|
<leader>l | Open Lazy (plugin manager) |
<leader>pl | Open Lazy |
<leader>pi | Install plugins |
<leader>pu | Update plugins |
<leader>ps | Sync plugins |
<leader>pS | Clear unused plugins |
Text Objects
| Keymap | Description |
|---|---|
af / if | Around/inside function |
ac / ic | Around/inside class |
ao / io | Around/inside block, conditional or loop |
aa / ia | Around/inside argument |
See Treesitter for more.
FtVim (Leader + F)
| Keymap | Description |
|---|---|
<leader>Fk | View all keymaps |
<leader>Fx | Enable/disable extras |
<leader>FH | Health check (:checkhealth ftvim) |
With the 42 Extra
| Keymap | Description |
|---|---|
<leader>Fh | Insert 42 header |
<leader>Fn | Norminette on the project |
<leader>Fe | Toggle exam mode |
<leader>FC | Check project before submitting |
<leader>Fm | Make |
<leader>Fv | Valgrind |
<leader>Fg | Generate compile_commands.json |
<leader>Ff | Format C code (42 norm) |
<leader>Fc | Count lines (42) |
See the 42 extra for details.
Debug (Leader + d)
With the Debugging extra (included in the 42 extra):
| Keymap | Description |
|---|---|
<F5> / <leader>dc | Run / Continue |
<leader>db | Toggle breakpoint |
<leader>dB | Conditional breakpoint |
<leader>dC | Run to cursor |
<leader>do / <leader>di / <leader>dO | Step over / into / out |
<leader>dl | Run last |
<leader>dr | Toggle REPL |
<leader>dt | Terminate |
<leader>du | Toggle debugger UI |
<leader>de | Evaluate expression |
Treesitter (Leader + T)
| Keymap | Description |
|---|---|
<leader>Ti | Treesitter info |