note

Neovim Cheatsheet

Comprehensive Neovim keybindings and commands including LazyVim, Telescope, and Harpoon

Neovim Cheatsheet

LazyVim: LazyVim Keymaps

File Navigation

ActionCommand
Open current directorynvim .
Open file explorer:Ex
Open file explorer in vertical split:Vex
Open file explorer in horizontal split:Sex

Windows Mode

ActionShortcut
Open window modectrl+w
Move around to windowsh,j,k,l
Open file in vertical splitv
Open file in horizontal splits
Close all splits but the current buffero

Commands

ActionCommand
Find config path:echo stdpath("config")
Show command registry:reg
Help:h
New tab:tabnew
New split of same file:split
New split of empty file:new
Enable line numbers:set nu
Disable line numbers:set nu!
Enable relative line numbers:set rnu
Disable relative line numbers:set rnu!
Expand tab menus<C-d>
Cycle forward in tab menus<C-n>
Cycle back in tab menu<C-p>

Normal Modes

ActionShortcut
Left, down, up, righth,j,k,l
Forward one wordw
Back one wordb
Center on promptzz
Copy lineyy
Paste line belowp
Paste line aboveP
Undou
Copy to system clipboard"+y
Copy and delete linedd
Delete to EOLD
Jump to x lines up9k
Jump to x lines down9j
Go to top of filegg
Go to bottom of fileGG
Delete line and enter insert modecc
Delete char and enter insert modes
Jump to first occurrence of charf<char>
Jump forward to next char match;
Jump backward to previous char match,
Jump up to first occurrence of chart<char>
Jump to next paragraph}
Jump to previous paragraph{
Jump down by half page<C-d>
Jump up by half page<C-u>
Jump between bracket or curly pairs%
Delete up to next curly and insertdi}
Delete word and insertciw
Delete up to quotedt"

Insert Mode

ActionShortcut
Insert before prompti
Insert at first non-space at beginning of lineI
Insert after prompta
Insert at EOLA
Insert new line belowo
Insert new line aboveO

Find / Replace

ActionCommand
Search:/<searchString>
Remove Highlights:nohls
Range Search (Highlight region):'<,'>%s/<searchString>
Single line search and replace:/s/<find>/<replace>
Search and replace full file global:/%s/<find>/<replace>/g
Search and replace with check:/%s/<find>/<replace>/gc
Regex find replace (Finds (foo && bar) and changes it to (bar && foo)):'<,'>s/(\(.*\) && \(.*\)) {\2 \&\& \1}

Macro Mode

ActionCommand
Start Macro modeq
End Macro modeq
Use macro@

Neo-Tree

ActionCommand
Close Neo-Tree:Neotree close

Avante

ActionShortcut
Next prompt]p
Previous prompt[p
Apply allA
Apply cursora
Retry requestr
Edit requeste
Switch windows<Tab>
Reverse switch<S-Tab>
Remove filed
Add file@
Close sidebarq
Show sidebarLeaderaa
Toggle visibilityLeaderat
Refresh sidebarLeaderar
Switch focusLeaderaf

Suggestion

ActionShortcut
Select modelLeadera?
New askLeaderan
Edit selected blocksLeaderae
Stop AI requestLeaderaS
Select historiesLeaderah
Accept suggestion<M-l>
Next suggestion<M-]>
Previous suggestion<M-[>
Dismiss suggestion<C-]>
Toggle debug modeLeaderad
Toggle suggestion displayLeaderas
Toggle repomapLeaderaR

Files

ActionShortcut
Add current bufferLeaderac
Add all buffer filesLeaderaB

Diff

ActionShortcut
Choose oursco
Choose theirsct
Choose all theirsca
Choose bothcb
Choose cursorcc
Move to next conflict]x
Move to previous conflict[x

Confirm

ActionShortcut
Focus confirm windowCtrlwf
Confirm codec
Confirm responser
Confirm inputi

Avante Commands

ActionCommand
Ask AI question:AvanteAsk [question] [position]
Build dependencies:AvanteBuild
Start chat session:AvanteChat
Edit code blocks:AvanteEdit
Switch focus:AvanteFocus
Refresh windows:AvanteRefresh
Switch AI provider:AvanteSwitchProvider
Show repo map:AvanteShowRepoMap
Toggle sidebar:AvanteToggle

Other

ActionShortcut
Terminal<C-n>
Switch window<C-ww>
Switch tabgt

Visual Modes

  • Enter visual mode by pressing v.
  • Use navigation controls to highlight text.
  • Paste where the cursor is.
  • Enter visual line mode by pressing V.
  • Entire line you are on is highlighted.
  • Paste on the next line.
ActionShortcut
Delete lined
Copy liney
Pastep
Jump between highlight start and endo

Harpoon

ActionShortcut
Append file to list<leader>a
Quick menu<C-e>
Jump to list item<C-hjkl>

Telescope

GitHub Repository

ActionShortcut
Find files<leader>ff
Live grep<leader>fg
Buffers<leader>fb
Help<leader>fh
Grep files in DIR<leader>sG
Search buffer<leader>sb
Search keymaps<leader>sk

Terminal

ActionShortcut
Terminal CWD<leader>fT
Terminal Root dir<leader>ft
Hide/Show Terminal<C-/>

LazyGit

ActionShortcut
Lazygit CWD<leader>gG
Lazygit Root dir<leader>gg

Marking

  • Marking allows you to jump to a specific line in a buffer or other file.
  • To jump to mark in a buffer use a lower case letter.
  • To jump to a mark in another file use an upper case letter.
  • To set a mark use m followed by a letter.
  • To see all marks use :marks.
  • To jump to a mark use ' followed by the letter of the mark.

Config

  • Source currently opened file with :so %.
  • nnoremap = normal mode, no remap.
  • inoremap = insert mode, no remap.