How do I save and restore my entire Vim session?
:mksession and :source
The :mksession command saves the current Vim session (windows, buffers, tabs, cursor positions) to a file.
2125 results for "i{ a{"
:mksession and :source
The :mksession command saves the current Vim session (windows, buffers, tabs, cursor positions) to a file.
:%S/old/new/g (vim-abolish)
vim-abolish by Tim Pope provides :%S (Subvert), a substitute command that preserves the case pattern of the original text.
set statusline=%{MyCustomFunc()}
How it works Vim's statusline supports the %{expr} syntax which evaluates a Vimscript expression and displays the result.
:profile start /tmp/profile.log | profile func *
When Vim feels sluggish during editing (not just at startup), the :profile command lets you measure the execution time of every function call.
<C-r>0
In Insert mode, {reg} pastes the contents of any register inline at the cursor.
(
The ( motion moves the cursor backward to the start of the current or previous sentence.
vim-polyglot
The vim-polyglot plugin is a curated collection of language packs for Vim that provides syntax highlighting, indentation, filetype detection, and compiler suppo
<C-k>
Vim has a built-in digraph system that lets you type special characters using short two-character codes.
:set shiftwidth=0
Setting shiftwidth=0 tells Vim to use the value of tabstop wherever shiftwidth would normally be consulted — for the > and and in insert mode, and auto-indent
:set grepprg=rg\ --vimgrep\ --smart-case
By default, Vim's :grep command calls the system grep.
<C-x><C-n>
triggers keyword completion that searches only the current buffer for matches, scanning forward from the cursor.
:set hlsearch
The hlsearch option highlights all matches of the current search pattern throughout the file, making it easy to see where matches occur.
<C-g> and <C-t>
While the search prompt is open (with incsearch enabled), pressing advances the cursor to the next match and moves it to the previous match — all without leav
/{pattern}
The / command initiates a forward search in the file.
:set nobackup noswapfile
Disabling backup and swap files prevents Vim from creating extra files alongside your source code.
:set concealcursor=nv
The 'concealcursor' option controls in which modes concealed text is revealed on the cursor line.
:set splitbelow splitright
How it works By default, Vim opens horizontal splits (:split or :sp) above the current window and vertical splits (:vsplit or :vsp) to the left.
:.+1,.+3d
Vim's Ex command addresses support arithmetic offsets relative to the current line (.
command-line #ex-commands #editing #navigation #command-line
gp
The standard p command pastes text after the cursor but leaves the cursor at the beginning of the pasted text.
:set switchbuf+=uselast
When jumps open the target buffer in an unexpected split, context switching gets expensive.