How do I scroll the view left or right without moving the cursor in Vim?
zl and zh
When a line is longer than the window width and wrap is off, Vim can display only part of it.
2277 results for "@a"
zl and zh
When a line is longer than the window width and wrap is off, Vim can display only part of it.
:tabdo
The :tabdo {cmd} command executes an Ex command in each open tab page sequentially, visiting every tab and running the command there.
buffers-windows #tabs #buffers #ex-commands #buffers-windows
readfile() and writefile()
readfile({path}) reads a file and returns its contents as a list of lines, and writefile({list}, {path}) writes a list of lines back to disk.
:argdo if search('\s\+$', 'nw') | echo expand('%') | endif
Before running destructive cleanup across many files, it helps to know which files will actually change.
command-line #command-line #search #whitespace #arglist #refactoring
:set pumheight=10
By default, Vim's completion popup menu (the PUM — Pop-Up Menu) can expand to fill the entire screen if there are many candidates.
g<
Pressing g or q to dismiss it again Example Tips :messages also shows recent messages (and those accumulate across the session), while g< only shows the last pa
:TOhtml
The :TOhtml command converts the current buffer — complete with its syntax highlighting colors — into a standalone HTML file.
[on / ]on / yon
The vim-unimpaired plugin by Tim Pope provides a consistent set of bracket-based mappings for toggling Vim options, navigating paired lists, and performing comm
gvV
gv is well known for reselecting the previous visual area, but pairing it with V is a practical upgrade when your next action needs linewise semantics.
:Rename {newname}
vim-eunuch (by Tim Pope) adds Unix shell operations as first-class Vim commands.
//
In Vim, pressing // (two forward slashes) in Normal mode repeats the last search pattern.
:jumps
How it works Vim keeps a jump list that records your cursor position every time you make a jump.
vim.lsp.config()
Neovim 0.
:set autowriteall and autocmd FocusLost * silent! wa
How it works Vim can be configured to automatically save your files when you switch to another window or application.
:%!{command}
The ! filter command in Vim sends a range of lines to an external program as standard input, then replaces those lines with the program's standard output.
:messages
:messages displays the full log of recent Vim messages — errors, warnings, echo output, and status notifications.
:cgetexpr systemlist('rg --vimgrep TODO')
When you already have a shell command that emits file:line:col:message records, :cgetexpr is a fast way to populate quickfix directly.
:Git
The vim-fugitive plugin by Tim Pope provides an interactive Git status window that lets you stage, unstage, diff, and commit files entirely from within Vim.
crs
The vim-abolish plugin by Tim Pope provides instant case coercion commands that convert the word under your cursor between common naming conventions.
zO
zO (uppercase O) opens the fold under the cursor and all folds nested inside it recursively.