How do I jump to the Nth line from the top or bottom of the visible screen using a count with H and L?
{count}H and {count}L
Most Vim users know H jumps to the first visible line, M to the middle, and L to the last.
{count}H and {count}L
Most Vim users know H jumps to the first visible line, M to the middle, and L to the last.
vim.keymap.set
vim.
gUU
The gUU command uppercases every character on the current line instantly — no visual selection or motion required.
:nnoremap <expr> {key} {expression}
The argument to any map command (:nmap, :inoremap, etc.
config #config #macros #insert-mode #normal-mode #ex-commands
:set nomodifiable
:set nomodifiable locks a buffer so that no changes can be made at all — not even temporary ones.
it and at
Vim provides two built-in text objects for HTML and XML tags: it (inner tag) and at (a tag).
editing #text-objects #editing #visual-mode #html #normal-mode
:2match Todo /FIXME/
Vim provides three independent match slots — :match, :2match, and :3match — each of which highlights a pattern using a specified highlight group.
:set foldmethod=expr
Setting foldmethod=expr tells Vim to call the foldexpr expression for every line to compute its fold level.
{n}<C-w>>
All four window resize mappings accept an optional count prefix that multiplies the resize amount.
:set foldtext={expr}
The foldtext option controls what Vim displays for a closed fold.
<C-c>
exits insert mode immediately but silently skips two important side effects that (and its equivalent ) always trigger: abbreviation expansion and InsertLeave au
/pattern\c
Vim's \c and \C atoms let you override the global ignorecase and smartcase settings on a per-search basis.
5:
Typing a count before : in normal mode automatically fills in a line range in the command line.
command-line #command-line #ex-commands #ranges #normal-mode
"#p
The # register holds the name of the alternate file — the file you were editing just before the current one.
50%
Prefixing the % command with a count jumps the cursor to that percentage through the file.
/pattern\C
Appending \C anywhere in a search pattern forces the entire search to be case-sensitive, regardless of whether ignorecase or smartcase is set.
search #search #case-sensitive #ignorecase #smartcase #normal-mode
<C-u> in insert mode
Pressing while in insert mode deletes all characters entered since you last entered insert mode on the current line.
fnameescape(filename)
When building Vim Ex commands dynamically, filenames with spaces, , %, #, [, or other special characters will be misinterpreted — the space looks like an argu
globpath(&rtp, 'pattern')
globpath() is a Vimscript function that searches all directories in a given path list for files matching a glob pattern.
:echohl WarningMsg | echo "message" | echohl None
:echohl sets the highlight group applied to subsequent :echo and :echom output.