Contents
Registers Marks Macros Text Objects Windows & Tabs LSP Lua Config Plugin System Treesitter Telescope Autocmds Terminal Mode

🆕 Registers Normal / Visual

Registers are named storage slots for text. Access them with " followed by the register name before an operator.

Named Registers (a–z)
"ayyYank line into register a
"apPaste from register a
"AyyAppend yank to register A
Special Registers
"0Last yank
"1–"9Delete history
""Default (unnamed)
"+System clipboard
"*Primary selection (X11)
"/Last search pattern
".Last inserted text
"%Current filename
":Last Ex command
Using in Insert / Command Mode
Ctrl+r aPaste register a while in Insert
Ctrl+r +Paste clipboard in Insert
:regList all registers
:reg a bShow registers a and b
Tip: Always use "0p to paste from your last yank, so deletes don't clobber it.

🏵 Marks Normal

Marks let you bookmark locations in files and jump back instantly.

Setting & Jumping
m{a-z}Set local mark (per file)
m{A-Z}Set global mark (cross-file)
'{mark}Jump to mark line
`{mark}Jump to exact mark position
''Jump to last jump location
`.Jump to last edit location
`[ / `]Start/end of last change
`< / `>Start/end of last visual
:marksList all marks
:delmarks aDelete mark a
Jump List & Change List
Ctrl+oGo to older jump position
Ctrl+iGo to newer jump position
g;Go to older change position
g,Go to newer change position
:jumpsShow jump list
:changesShow change list

▶ Macros Normal

Record a sequence of commands and replay them. Essential for repetitive bulk edits.

Recording & Playing
q{a-z}Start recording into register
qStop recording
@{a-z}Play macro
@@Replay last macro
5@aPlay macro a 5 times
:norm @aRun macro on each line
Workflow: Position cursor at start → qa → make your edits → q → move to next item → @a. Use 100@a to run it 100 times (it stops at errors).
Editing a Macro
:let @a='Edit macro a directly
"apPaste macro to edit in buffer
"ayyYank edited macro back

▩ Text Objects Operator + Object

Text objects let you operate on semantic units: words, sentences, blocks, and delimiters. Used as the motion part of an operator.

Inner (i) vs Around (a)

i = content only  |  a = content + surrounding delimiters/whitespace

iw / awWord
is / asSentence
ip / apParagraph
i" / a"Double-quoted string
i' / a'Single-quoted string
i` / a`Backtick string
i( / a(Parentheses
i[ / a[Brackets
i{ / a{Braces
it / atHTML/XML tag
Examples:
ci" — change content inside quotes
da{ — delete block including braces
yip — yank current paragraph
vat — visually select around HTML tag
2i( — operate on 2nd level parens
Neovim Treesitter Text Objects plugin

With nvim-treesitter-textobjects, you get syntax-aware objects:

ifInner function body
afAround function (with signature)
icInner class
iaInner argument/parameter

▩ Windows & Tabs Normal

Splits
:spHorizontal split
:vspVertical split
Ctrl+w sHorizontal split
Ctrl+w vVertical split
Ctrl+w h/j/k/lNavigate splits
Ctrl+w H/J/K/LMove split direction
Ctrl+w =Equalize split sizes
Ctrl+w _Maximize height
Ctrl+w |Maximize width
Ctrl+w qClose split
Ctrl+w oClose all other splits
Tabs
:tabnewOpen new tab
:tabnNext tab
:tabpPrevious tab
gtNext tab (normal mode)
gTPrevious tab
:tabcloseClose current tab
:tabonlyClose all other tabs
:tabsList all tabs
Buffers
:lsList buffers
:bn / :bpNext/prev buffer
:b{n}Go to buffer n
:bdDelete (close) buffer

⚡ LSP (Language Server Protocol) neovim native

Neovim has built-in LSP support since 0.5. Configure with vim.lsp APIs or use nvim-lspconfig for easy setup.

Default LSP Keymaps
gdGo to definition
gDGo to declaration
grShow references
giGo to implementation
KHover documentation
Ctrl+kSignature help
<leader>rnRename symbol
<leader>caCode actions
[d / ]dPrev/next diagnostic
<leader>eShow diagnostic float
:LspInfoShow active LSP clients
Minimal nvim-lspconfig Setup (Lua)
local lspconfig = require('lspconfig')

-- TypeScript / JavaScript
lspconfig.ts_ls.setup({})

-- Python
lspconfig.pyright.setup({})

-- Rust
lspconfig.rust_analyzer.setup({})

-- Lua (for Neovim config)
lspconfig.lua_ls.setup({
  settings = {
    Lua = { globals = { 'vim' } }
  }
})
Tip: Use mason.nvim to automatically install language servers with :Mason.

🌐 Lua Configuration neovim native

Neovim uses Lua as its primary configuration language (as of 0.5+). Your config lives at:

~/.config/nvim/init.lua

Or as a structured module:

~/.config/nvim/lua/
Setting Options
-- vim.opt is the modern API
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.updatetime = 50
Keymaps
-- vim.keymap.set(mode, keys, action, opts)
local map = vim.keymap.set

-- Set leader key
vim.g.mapleader = " "

-- Navigation
map("n", "<leader>pf", vim.cmd.Ex)

-- Move lines in visual
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv=gv")

-- Keep cursor centered on scroll
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
Useful vim.api and vim.fn calls
vim.api.nvim_create_autocmdCreate autocommand
vim.api.nvim_create_user_commandCreate user command
vim.api.nvim_buf_get_linesGet buffer lines
vim.fn.expand('%')Current file name
vim.fn.getcwd()Working directory
vim.notify("msg")Show notification

🔌 Plugin System ecosystem

The most popular plugin manager is lazy.nvim. Plugins are declared as Lua tables with lazy loading support.

lazy.nvim bootstrap + example
-- ~/.config/nvim/init.lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  -- Fuzzy finder
  { "nvim-telescope/telescope.nvim", tag = "0.1.x",
    dependencies = { "nvim-lua/plenary.nvim" } },
  -- Syntax highlighting
  { "nvim-treesitter/nvim-treesitter",
    build = ":TSUpdate" },
  -- LSP config helpers
  { "neovim/nvim-lspconfig" },
  -- Completion
  { "hrsh7th/nvim-cmp" },
})
Essential plugins: telescope.nvim · nvim-treesitter · nvim-lspconfig · mason.nvim · nvim-cmp · null-ls / none-ls · gitsigns.nvim · which-key.nvim · lualine.nvim · oil.nvim / nvim-tree

🌳 Treesitter neovim native (0.9+)

Treesitter provides accurate, incremental syntax parsing, enabling better highlighting, indentation, and navigation than regex-based syntax files.

Commands
:TSInstall {lang}Install parser for language
:TSInstallInfoShow install status
:TSUpdateUpdate all parsers
:TSBufToggle highlightToggle TS highlight
:InspectTreeShow syntax tree (Nvim 0.9+)
Config
require('nvim-treesitter.configs').setup({
  ensure_installed = {
    "lua", "python", "typescript",
    "rust", "go", "html", "css"
  },
  highlight = { enable = true },
  indent = { enable = true },
})

🔭 Telescope plugin

Fuzzy-finder framework for finding anything — files, grep, LSP symbols, git commits, and more.

Common Pickers
:Telescope find_filesFuzzy file finder
:Telescope live_grepSearch file contents
:Telescope buffersOpen buffers
:Telescope oldfilesRecent files
:Telescope git_commitsGit commit log
:Telescope lsp_referencesLSP references
:Telescope keymapsBrowse all keymaps
:Telescope help_tagsSearch help docs
Telescope Keymaps (in picker)
Ctrl+n / pNext/prev result
Ctrl+xOpen in horizontal split
Ctrl+vOpen in vertical split
Ctrl+tOpen in new tab
Ctrl+qSend all to quickfix
?Show all mappings

◯ Autocommands Lua API

Autocommands run Lua (or Vimscript) in response to editor events.

Examples
local augroup = vim.api.nvim_create_augroup("MyGroup", {})

-- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
  group = augroup,
  callback = function()
    vim.highlight.on_yank()
  end,
})

-- Remove trailing whitespace on save
vim.api.nvim_create_autocmd("BufWritePre", {
  group = augroup,
  pattern = "*",
  command = [[%s/\s\+$//e]],
})

-- Format on save (LSP)
vim.api.nvim_create_autocmd("BufWritePre", {
  group = augroup,
  callback = function() vim.lsp.buf.format() end,
})

📺 Terminal Mode neovim native

Neovim has a built-in terminal emulator — run shells and programs directly in a buffer.

Opening & Using
:termOpen terminal in current window
:sp | termTerminal in horizontal split
:vsp | termTerminal in vertical split
i / aEnter terminal (insert) mode
Ctrl+\ Ctrl+nExit to Normal mode
Ctrl+w + navSwitch window from terminal
Tip: Map <C-\><C-n> to something easier:
map("t", "<Esc><Esc>", "<C-\\><C-n>")