How do I convert space-indented code to tab-indented code in Vim?
:set noexpandtab | retab!
When you inherit space-indented code and need to switch to tabs, :retab! (with the bang) converts groups of spaces into tabs throughout the file.
2125 results for "i" a""
:set noexpandtab | retab!
When you inherit space-indented code and need to switch to tabs, :retab! (with the bang) converts groups of spaces into tabs throughout the file.
{count}n
Like most Vim motions, the n and N search repeat commands accept a count prefix.
:nnoremap <buffer> <leader>r :!python %<CR>
How it works By adding to a mapping command, the mapping only applies to the current buffer.
:set showcmd
The showcmd option makes Vim display the currently-typed command in the bottom-right corner of the screen, giving you live feedback as you build up key sequence
vim.system({cmd}, {opts}, callback)
vim.
g-
Vim's undo history is a tree, not a linear stack.
<C-r><C-l>
Pressing on the command line inserts the full text of the current buffer line (the line the cursor is on when you pressed :) directly at the command-line cursor
:doautocmd
:doautocmd fires any autocommand event manually, exactly as if that event had occurred naturally.
:set diffopt+=vertical,algorithm:patience,indent-heuristic
Default diff behavior can look noisy on refactors where blocks move or indentation shifts.
:keepalt edit path/to/file\<CR>
Experienced Vim workflows often depend on the alternate file (#) for fast toggling with , quick diffs, or two-file review loops.
:sort
The :sort command sorts lines in the current buffer or a specified range alphabetically.
:set jumpoptions+=stack,view
When you jump around large files with and , the default behavior can feel disorienting because your cursor position may return but your viewport context does no
:let @/ = '\V' . escape(@0, '\')
When the text you yank contains regex characters, a normal / search can produce noisy or surprising matches.
:set wildignore
:set wildignore defines a comma-separated list of glob patterns that Vim excludes from wildcard expansion and file completion.
:keeppattern {cmd}
Many Ex commands silently overwrite the search register (@/), which changes your hlsearch highlighting and n/N behavior.
:set shortmess+=S
Vim's search count feedback ([3/27]) is useful until it starts flooding the command area during rapid navigation.
g+ and g-
Vim's undo history is a tree, not a linear stack.
`[ and `]
The ` [ ` and ] ` marks automatically track the boundaries of the last changed or yanked text.
:args **/*.js | argdo %s/old/new/ge | update
The argument list (arglist) is Vim's mechanism for loading a set of files and running commands across all of them.
command-line #command-line #ex-commands #arglist #productivity #batch #editing
:set belloff=all
The belloff=all option disables all error bells and visual bells in Vim.