How do I define key mappings in Neovim using Lua instead of the old Vimscript API?
vim.keymap.set
vim.
2125 results for "i( a("
vim.keymap.set
vim.
gj
The gj command moves the cursor down by one display line rather than one physical line.
:/pattern1/,/pattern2/
Ex command ranges in Vim are not limited to line numbers and marks — you can use /pattern/ as a range boundary to select lines between any two matching patter
:packadd termdebug
Vim ships with a built-in termdebug plugin that integrates GDB directly into the editor.
:breakadd func {funcname}
Vim has a built-in debugger for Vimscript that most users never discover.
vim.print()
vim.
"ayy "byy "cyy
How it works Vim provides 26 named registers (a through z) that you can use as independent clipboards.
:let @q = substitute(@q, "old", "new", "g")
Vim macros are stored as plain text in registers, which means you can inspect and modify them like any other string.
:set concealcursor=nvi
When 'conceallevel' is 2 or higher, Vim hides syntax markers—turning raw Markdown like bold into visual bold or collapsing LaTeX commands.
g; / g,
The g; and g, commands let you navigate Vim's changelist — a per-buffer history of every position where you made a change.
navigation #navigation #changelist #editing #normal-mode #marks
:set wildmenu
The wildmenu option enhances Vim's command-line completion by showing a horizontal menu of matches above the command line when you press .
config #config #command-line #completion #productivity #vimrc
]`
Most users jump to marks directly ('a, ` a `), but when a file has many lowercase marks, stepping through them in order is faster than remembering each name.
]' and ['
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
]c and [c
When files are open in Vim's built-in diff mode — whether via vimdiff, :diffsplit, or :diffthis — the ]c and [c motions let you jump precisely between chang
:diffsplit {file}
:diffsplit {file} opens a file in a horizontal split and immediately activates diff mode, highlighting the differences between both buffers.
; / ,
After using f, t, F, or T to jump to a character on the current line, pressing ; repeats the same search in the same direction, and , repeats it in the opposite
navigation #navigation #motions #normal-mode #editing #productivity
:verbose autocmd BufWritePre
When a save hook starts behaving unexpectedly, the hard part is usually finding who defined it.
:tabnew / gt / gT
Vim's tab pages let you organize your workspace into separate views, each containing its own window layout.
buffers-windows #buffers #windows #tabs #navigation #productivity
0 or ^ at start of macro
A common macro pitfall is assuming the cursor starts at a specific column.
{count}r{char}
The {count}r{char} command replaces a precise number of characters starting at the cursor position with a single repeated character.