How do I open a file explorer sidebar in Vim with NERDTree?
:NERDTreeToggle
The NERDTree plugin provides a full-featured file explorer sidebar in Vim, giving you a visual directory tree that you can navigate, search, and manipulate file
:NERDTreeToggle
The NERDTree plugin provides a full-featured file explorer sidebar in Vim, giving you a visual directory tree that you can navigate, search, and manipulate file
s{char}{char}
The vim-sneak plugin by Justin Keyes provides a motion that lets you jump to any visible location by typing just two characters.
<Leader><Leader>w
The vim-easymotion plugin replaces Vim's default motion commands with a visual overlay system that lets you jump to any visible position on screen in just two o
:Files
The fzf.
:Buffers
The fzf.
]c / [c
The vim-gitgutter plugin shows Git diff markers in the sign column and provides ]c and [c mappings to jump between changed hunks — groups of added, modified,
<C-w>| and <C-w>_ / <C-w>=
Vim lets you temporarily maximize a split window to full width or full height, and then restore all windows to equal sizes with =.
buffers-windows #windows #splits #navigation #productivity #layout
: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
<C-^>
Pressing (Ctrl-6 on most keyboards) instantly toggles between the current buffer and the alternate file — the last file you were editing.
buffers-windows #navigation #buffers #normal-mode #productivity #windows
:vimgrep /pattern/ **/*.ext | copen
The :vimgrep command searches for a regex pattern across multiple files and populates the quickfix list with every match.
search #search #quickfix #ex-commands #navigation #productivity #grep
zt
The zt command repositions the viewport so that the line where your cursor sits moves to the top of the screen, without changing your cursor position within the
navigation #navigation #scrolling #normal-mode #viewport #productivity
:windo set scrollbind
The scrollbind option locks two or more windows together so that scrolling in one window automatically scrolls the others by the same amount.
buffers-windows #windows #navigation #splits #diff #productivity
/pattern/+3
Vim's search command accepts an offset after the pattern that shifts where the cursor lands relative to the match.
g*
The g command searches forward for the text under the cursor without adding word boundary anchors.
search #search #navigation #normal-mode #motions #productivity
<C-w>H / <C-w>J / <C-w>K / <C-w>L
The H, J, K, and L commands move the current window to the far left, bottom, top, or right of the screen respectively, rearranging your entire split layout.
buffers-windows #windows #buffers #navigation #splits #layout
; / ,
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
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
Vim remembers the last cursor position for every file you edit (stored in the viminfo or shada file), but by default it opens files at line 1.
gi
The gi command moves the cursor to the position where you last exited insert mode and immediately enters insert mode again.
navigation #navigation #insert-mode #marks #normal-mode #productivity
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
]] / [[
The ]] and [[ commands let you jump forward and backward between section boundaries, which in most programming languages correspond to function or method defini
navigation #navigation #motions #normal-mode #code #functions