Leader key
The leader key is set to Space:
vim . g . mapleader = " "
vim . g . maplocalleader = " "
All custom keybindings use <leader> (Space) as the prefix.
Essential keybindings
Navigation
Line navigation H - Jump to start of line (^)
L - Jump to end of line (g_)
Buffer navigation < Right > - Next buffer
< Left > - Previous buffer
Search navigation n - Next match ( centered )
N - Previous match ( centered )
* - Search word under cursor ( centered )
Quickfix navigation < M-j > - Next quickfix item
< M-k > - Previous quickfix item
< M-q > - Open quickfix list
Editing
Moving lines
In visual mode, move selected lines up or down: J - Move lines down
K - Move lines up
Indenting
Visual mode indentation that maintains selection: < - Indent left (maintains selection )
> - Indent right (maintains selection )
Split line
Split line at cursor position: X - Split line (maintains indentation)
Delete without yank
Delete without copying to clipboard: d - Delete without copying
D - Delete to end of line without copying
Regular delete operations are mapped to the black hole register. Use cut or visual+yank for clipboard.
LSP features
Language server features are available automatically when a language server is attached:
Code actions
< leader >ca - Show code actions ( normal or visual mode)
< leader >cl - Run code lens actions
Code actions use tiny-code-action for a minimal, fast interface.
Diagnostics
[d - Previous diagnostic
]d - Next diagnostic
Call hierarchy
< leader > ci - Show incoming calls (who calls this)
< leader > co - Show outgoing calls (what this calls)
Git workflow
Gitsigns (hunk operations)
Navigation
Viewing changes
Staging
Reverting
[g - Previous hunk
]g - Next hunk
< leader > gp - Preview hunk inline
< leader >gP - Preview hunk in floating window
< leader >gb - Git blame line
< leader >gB - Git blame buffer
< leader >GB - Toggle blame mode ( inline )
< leader >ga - Stage hunk
< leader >gA - Stage entire buffer
< leader >gu - Unstage hunk
< leader >gr - Reset hunk (discard changes)
< leader >gR - Reset buffer (discard all changes)
Neogit (interactive git)
< leader >gn - Open Neogit status
< leader >gc - Open commit dialog
Inside Neogit, press ? to see all available commands. Common operations:
s - stage/unstage
c - commit menu
P - push menu
F - pull menu
z - stash menu
CodeDiff (diff viewer)
Basic diffs < leader >dd - Toggle diff explorer
< leader >df - Diff current file vs HEAD
< leader >gD - Diff buffer vs HEAD ( split )
History < leader >dh - Full repository history
< leader >d. - Current file history
Branch comparison < leader >dm - Diff vs origin/main (merge-base)
< leader >dM - Diff vs custom branch
Search and replace
Grug-far (project-wide search)
< leader >sR - Open search/replace interface
< leader >sW - Replace word under cursor
< leader >sF - Replace in current file
< leader >sv - Replace visual selection (visual mode)
Open grug-far
Press <leader>sR to open the search interface.
Enter search term
The interface starts in insert mode. Type your search pattern.
Preview results
Results appear as you type (debounced by 500ms).
Enter replacement
Move to the replace field and enter your replacement text.
Execute replace
Review changes and execute the replacement.
Treesitter text objects
Treesitter provides semantic code navigation:
Text objects
Functions
Classes
Parameters
Control flow
af - Around function
if - Inside function
# Navigation
]f - Next function start
]F - Next function end
[f - Previous function start
[F - Previous function end
Example: daf deletes entire function, vif selects function body. ac - Around class
ic - Inside class
# Navigation
]c - Next class start
]C - Next class end
[c - Previous class start
[C - Previous class end
aa - Around argument
ia - Inside argument
# Swapping
< leader >a - Swap with next parameter
< leader >A - Swap with previous parameter
Example: daa deletes parameter and comma, dia deletes parameter only. # Loops
ao - Around loop
io - Inside loop
# Conditionals
ai - Around conditional
ii - Inside conditional
# Returns
ar - Around return
ir - Inside return
# Scope
as - Around scope
Incremental selection
< leader > ss - Start selection
< leader > si - Increment selection (expand to next node)
< leader > sc - Increment to scope
< leader > sn - Decrement selection ( shrink )
Start with <leader>ss, then repeatedly press <leader>si to expand selection to larger syntax nodes.
File operations
Utilities
< leader >rc - Reload current file (: source %)
< leader >x - Execute current line as Lua ( normal mode)
< leader >x - Execute selection as Lua (visual mode)
< leader > cp - Copy file path with line number
Terminal
< Esc >< Esc > - Exit terminal mode
Floating windows
< C-w >f - Focus first floating window
gX - Open link under cursor (system default)
Completion
Completion is powered by blink.cmp with ghost text:
Basic navigation
Features
Sources
< Tab > - Accept completion / Next item
< S-T ab> - Previous item
< C-j > - Next item ( alternative )
< C-k > - Previous item ( alternative )
Ghost text : Shows inline preview of top completion
Auto-brackets : Automatically adds function parentheses
Documentation : Auto-shows docs after 200ms
Signature help : Shows function signatures while typing
Fuzzy matching : Rust-powered fuzzy search
Completion sources in priority order:
LazyDev (Neovim Lua API)
LSP (language server)
Path (file paths)
Snippets (custom snippets)
Buffer (current buffer words)
Dadbod (SQL, only in SQL files)
Configuration options
Key editor settings configured in lua/config/options.lua:
-- Indentation
vim . opt . expandtab = true -- Use spaces, not tabs
vim . opt . shiftwidth = 4 -- 4 spaces per indent
vim . opt . tabstop = 4 -- Tab displays as 4 spaces
-- UI
vim . opt . number = true -- Show line numbers
vim . opt . relativenumber = true -- Relative line numbers
vim . opt . cursorline = true -- Highlight current line number
vim . opt . signcolumn = "yes:1" -- Always show sign column
-- Search
vim . opt . ignorecase = true -- Case-insensitive search
vim . opt . smartcase = true -- Unless capital letters used
-- Editor behavior
vim . opt . undofile = true -- Persistent undo
vim . opt . updatetime = 400 -- Faster completion (default 4000ms)
vim . opt . timeoutlen = 1000 -- Wait 1s for key sequence
vim . opt . mouse = "a" -- Enable mouse support
Common workflows
Workflow: Fix type errors
View diagnostics
Open diagnostics with <leader>q to see all issues.
Navigate to error
Use ]d to jump to next diagnostic.
Show details
Press <leader>de to see full error message.
Apply fix
Use <leader>ca for code actions if available.
Workflow: Refactor function
Select function
Position cursor inside function, press vaf to select entire function.
Extract or modify
Use LSP code actions (<leader>ca) or manually edit.
Format
Save file with :w - formatting happens automatically on save.
Workflow: Stage and commit changes
Review changes
Navigate hunks with ]g and [g. Preview with <leader>gp.
Stage hunks
Press <leader>ga on each hunk to stage, or <leader>gA to stage entire file.
Open Neogit
Press <leader>gn to open Neogit status.
Commit
In Neogit, press c for commit menu, then c again to commit. Or use <leader>gc directly.
Workflow: Search and replace across project
Open grug-far
Press <leader>sR or <leader>sW (for word under cursor).
Configure search
Enter search term, replacement, and optionally filter by file paths.
Review results
Browse results with folding support. Press <CR> to jump to location.
Execute replace
Follow on-screen instructions to replace all matches.
Tips and tricks
Disable command window The annoying q: command window is disabled. Use :q to quit.
Line numbers in visual mode Press <leader>ln in visual mode to copy highlighted line numbers.
Preview substitutions Use :%s/foo/bar/g - live preview shows in split window.
Format on save Formatting happens automatically when you save. No manual command needed.
Plugin-specific help
Most plugins have their own help and keybinding lists:
Neogit
CodeDiff
Lazy
Treesitter
# Inside Neogit
? - Show help
Health check
Run health checks to diagnose issues:
:checkhealth # All health checks
:checkhealth vim. lsp # LSP health
:checkhealth nvim-treesitter # Treesitter health
Next steps
Customization Learn how to customize keybindings and settings
LSP configuration Configure language servers and add custom settings