Skip to content

Neovim Commands (LazyVim)

LazyVim on top of Neovim. All keybindings assume the default <leader> is <Space>.

KeybindingAction
<leader>sfFind files by name
<leader>sgLive grep across all files
<leader>swSearch word under cursor
<leader>/Search in current buffer
<leader>sRResume last search
<leader>s"Search registers
<leader>saSearch autocommands
<leader>sbSearch open buffers
<leader>scSearch command history
<leader>sCSearch commands
<leader>sdSearch diagnostics (document)
<leader>sDSearch diagnostics (all)
<leader>shSearch help tags
<leader>skSearch keymaps
<leader>smSearch marks
<leader>sMSearch man pages
<leader>soSearch options
<leader>ssSearch document symbols
<leader>sSSearch workspace symbols
KeybindingAction
<C-n> / <C-p>Navigate results
<CR>Open file
<C-x>Open in horizontal split
<C-v>Open in vertical split
<C-t>Open in new tab
<C-q>Send all results to quickfix
<M-q>Send selected to quickfix
<C-u> / <C-d>Scroll preview up/down
KeybindingAction
<leader>eToggle file explorer
<leader>feFocus file explorer
<leader>fEExplorer at cwd
KeyAction
aAdd file/directory (end / for dir)
dDelete
rRename
cCopy
mMove
yCopy path to clipboard
pPaste
PPreview
sOpen in split
SOpen in vertical split
.Toggle hidden files
qClose
KeybindingAction
<leader>bbSwitch buffers
<leader>bdDelete buffer
<leader>bDDelete buffer (force)
<leader>boDelete other buffers
<leader>bpToggle pin buffer
<S-h>Previous buffer
<S-l>Next buffer
<leader><tab>lLast tab
<leader><tab>fFirst tab
<leader><tab><tab>New tab
<leader><tab>dClose tab
<leader><tab>]Next tab
<leader><tab>[Previous tab
KeybindingAction
gdGo to definition
gDGo to declaration
grGo to references
gIGo to implementation
gyGo to type definition
KHover documentation
gKSignature help
<C-o>Jump back
<C-i>Jump forward
<C-]>Follow tag/definition
%Jump to matching bracket
]] / [[Next/prev class or section
]f / [fNext/prev function start
KeybindingAction
sFlash jump (in normal mode)
SFlash treesitter select
rRemote flash (operator mode)
<C-s>Toggle flash search
KeybindingAction
<C-h/j/k/l>Navigate between splits
<leader>-Split horizontal
<leader>|Split vertical
<C-w>=Equalize splits
<C-w>oClose other windows
<leader>wdDelete window
<leader>wmMaximize toggle
<C-Up/Down>Resize height
<C-Left/Right>Resize width
KeybindingAction
<leader>caCode actions
<leader>cASource action
<leader>crRename symbol
<leader>cfFormat file
<leader>cFFormat range
<leader>cdLine diagnostics
<leader>clLSP info
]d / [dNext/prev diagnostic
]e / [eNext/prev error
]w / [wNext/prev warning
" Toggle inline diagnostics
:lua vim.diagnostic.config({ virtual_text = not vim.diagnostic.config().virtual_text })
" Show all diagnostics in location list
:lua vim.diagnostic.setloclist()
" Show all diagnostics in quickfix
:lua vim.diagnostic.setqflist()

LazyVim’s DAP integration requires the lazyvim.plugins.extras.dap.core extra.

KeybindingAction
<leader>dbToggle breakpoint
<leader>dBConditional breakpoint
<leader>dcContinue / start
<leader>dCRun to cursor
<leader>dsStep over
<leader>diStep into
<leader>doStep out
<leader>dpPause
<leader>drToggle REPL
<leader>dlRun last
<leader>dtTerminate
<leader>duToggle DAP UI
<leader>deEvaluate expression
<leader>dwToggle watches
-- In lua/plugins/dap-python.lua
return {
"mfussenegger/nvim-dap-python",
ft = "python",
dependencies = { "mfussenegger/nvim-dap" },
config = function()
require("dap-python").setup("python3")
end,
}

Requires the lazyvim.plugins.extras.test.core extra.

KeybindingAction
<leader>ttRun nearest test
<leader>tTRun file tests
<leader>trRun last test
<leader>tsToggle summary
<leader>toToggle output
<leader>tSStop tests
KeybindingAction
<leader>ggOpen Lazygit
<leader>gfGit file history
<leader>glGit log
<leader>gLGit log (cwd)
<leader>gbGit blame line
<leader>gBGit browse (open URL)
]h / [hNext/prev hunk
<leader>ghsStage hunk
<leader>ghrReset hunk
<leader>ghpPreview hunk
<leader>ghbBlame line (full)
<leader>ghdDiff this
CommandAction
:LazyPlugin manager (install/update/log)
:Lazy syncUpdate all plugins
:Lazy cleanRemove unused plugins
:Lazy healthCheck plugin health
:MasonLSP/linter/formatter installer
:LazyExtrasEnable/disable extra plugins
:checkhealthDiagnose issues
" Open terminal
:terminal
" Diff two buffers side by side
:diffthis " (in each buffer)
:diffoff " (to stop)
" Replace in file
:%s/old/new/gc " with confirmation
:%s/old/new/g " without confirmation
" Replace in visual selection
:'<,'>s/old/new/g
" Execute shell command, insert output
:r !date
:r !curl -s https://httpbin.org/ip
" Sort lines (visual selection)
:'<,'>sort
:'<,'>sort u " unique
:'<,'>sort n " numeric
" Save as root
:w !sudo tee %

LazyVim uses four config files in lua/config/:

~/.config/nvim/lua/config/
├── autocmds.lua # Autocommands
├── keymaps.lua # Custom keybindings
├── lazy.lua # lazy.nvim bootstrap (rarely edited)
└── options.lua # Vim options
-- lua/config/keymaps.lua
local map = vim.keymap.set
-- Quick save
map("n", "<leader>w", "<cmd>w<cr>", { desc = "Save" })
-- Move lines up/down in visual mode
map("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move line down" })
map("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move line up" })
-- Center after jumps
map("n", "<C-d>", "<C-d>zz", { desc = "Scroll down (centered)" })
map("n", "<C-u>", "<C-u>zz", { desc = "Scroll up (centered)" })
map("n", "n", "nzzzv", { desc = "Next search (centered)" })
map("n", "N", "Nzzzv", { desc = "Prev search (centered)" })
-- Filetype-specific keymaps
vim.api.nvim_create_autocmd("FileType", {
pattern = "python",
callback = function()
map("n", "<leader>pt", "<cmd>lua require('neotest').run.run()<cr>",
{ buffer = true, desc = "Run test" })
map("n", "<leader>pb", "<cmd>lua require('dap').toggle_breakpoint()<cr>",
{ buffer = true, desc = "Toggle breakpoint" })
end,
})
-- lua/config/options.lua
local opt = vim.opt
opt.scrolloff = 8 -- Lines above/below cursor
opt.relativenumber = true -- Relative line numbers (LazyVim default)
opt.wrap = false -- No line wrap
opt.tabstop = 4 -- Tab width
opt.shiftwidth = 4 -- Indent width
opt.expandtab = true -- Spaces not tabs
opt.clipboard = "unnamedplus" -- System clipboard (LazyVim default)
-- lua/plugins/example.lua
-- Each file in lua/plugins/ returns a table of plugin specs
return {
-- Override existing plugin config
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "python", "typescript", "lua", "rust", "go" },
},
},
-- Add a new plugin
{
"github/copilot.vim",
event = "InsertEnter",
},
-- Disable a LazyVim default plugin
{ "folke/flash.nvim", enabled = false },
}

Enable via :LazyExtras or lazyvim.json:

{
"extras": [
"lazyvim.plugins.extras.lang.python",
"lazyvim.plugins.extras.lang.typescript",
"lazyvim.plugins.extras.lang.rust",
"lazyvim.plugins.extras.lang.go",
"lazyvim.plugins.extras.dap.core",
"lazyvim.plugins.extras.test.core"
]
}

Each language extra installs the appropriate LSP server, formatter, linter, and treesitter grammar. :Mason shows what each extra installed.

Press <leader> and wait — which-key shows all available mappings grouped by prefix. Drill down by pressing the group key:

PrefixGroup
<leader>bBuffers
<leader>cCode
<leader>dDebug
<leader>fFile/find
<leader>gGit
<leader>ghGit hunks
<leader>sSearch
<leader>tTest
<leader>uUI toggles
<leader>wWindows
<leader>xDiagnostics/quickfix
<leader><tab>Tabs
  • tmux — Sessions, windows, panes, copy mode
  • Terminal Emulators — iTerm2 vs Ghostty, rendering
  • Debugging — Debuggers and profilers beyond the editor
  • Git — Git commands complementing Lazygit
  • CLI-First — Why terminal-first workflows