Neovim Cheat Sheet

Neovim is a highly extensible text editor and an improved version of the classic Vim editor. Here’s a basic cheat sheet to help you get started with Neovim:

Navigation

  • Move Cursor:
    • h, j, k, l – Left, Down, Up, Right
    • w, b – Move forward/backward by word
  • Scrolling:
    • Ctrl + u – Scroll up
    • Ctrl + d – Scroll down
    • Ctrl + e – Move view down
    • Ctrl + y – Move view up
  • Go to Line:
    • :<line_number> – Jump to a specific line
  • Page Navigation:
    • Ctrl + f – Move forward one page
    • Ctrl + b – Move backward one page
    • Ctrl + u – Move up half page
    • Ctrl + d – Move down half page

Editing

  • Insert Mode:
    • i – Insert before cursor
    • I – Insert at the beginning of the line
    • a – Insert after cursor
    • A – Insert at the end of the line
  • Visual Mode:
    • v – Start visual mode
    • V – Start visual line mode
    • Ctrl + v – Start visual block mode
  • Copy, Cut, Paste:
    • y – Copy (yank)
    • d – Cut (delete)
    • p – Paste after cursor
    • P – Paste before cursor
  • Undo and Redo:
    • u – Undo
    • Ctrl + r – Redo

Files and Buffers

  • Open File:
    • :e <filename> – Open a file
  • Save and Quit:
    • :w – Save changes
    • :q – Quit
    • :wq – Save and quit
  • Buffers:
    • :bnext – Next buffer
    • :bprev – Previous buffer
    • :bd – Close buffer

Search and Replace

  • Search:
    • /pattern – Search forward
    • ?pattern – Search backward
    • n – Next occurrence
    • N – Previous occurrence
  • Replace:
    • :%s/old/new/g – Replace all occurrences
    • :s/old/new/g – Replace in the current line

Miscellaneous

  • Command-line Mode:
    • : – Enter command-line mode
  • Marks:
    • m<letter> – Create a mark
    • '<letter>` – Jump to a mark
  • Tabs:
    • :tabnew – Open a new tab
    • gt – Switch to the next tab
    • gT – Switch to the previous tab
  • Windows:
    • Ctrl + w + <direction> – Move between windows
    • :vsp – Open a vertical split
    • :sp – Open a horizontal split
  • Exiting Neovim:
    • :qa! – Quit all without saving changes

Neovim has many more features and commands, so feel free to explore the documentation and community resources for more advanced usage.