How do I view a file as it existed at a previous Git commit in Vim?
:Gedit HEAD~3:%
The vim-fugitive plugin lets you open any version of any file from your Git history directly in a Vim buffer using the :Gedit command.
254 results for ":split"
:Gedit HEAD~3:%
The vim-fugitive plugin lets you open any version of any file from your Git history directly in a Vim buffer using the :Gedit command.
:%s/,/\r/g
In Vim's substitute command, \r in the replacement string inserts a newline.
:find
The :find command searches for a file by name across all directories listed in Vim's path option, so you can open files without typing full paths.
<C-w>z
Pressing z closes the preview window from any window in the current tab page.
:lgrep /pattern/ % | lopen
Quickfix is global, but sometimes you want a narrower search workspace tied to one window.
:enew | setlocal buftype=nofile bufhidden=wipe noswapfile
A scratch buffer is a temporary, unnamed buffer that exists only in memory — it won't prompt you to save when you close it and leaves no trace on disk.
buffers-windows #buffers #editing #ex-commands #productivity #workflow
:lvimgrep /TODO/j **/* | lopen
When you are working in split-heavy sessions, global quickfix results can become noisy because every window shares the same list.
:find **/*.py
Vim's built-in :find command supports recursive glob patterns, making it possible to locate and open files anywhere in a project without installing a fuzzy find
:diffthis
You often have two files open side by side and want to compare them without leaving Vim or launching vimdiff.
: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.
:set spelloptions=camel
By default, Vim treats camelCase as a single word and flags it as a spelling error even when both camel and case are correctly spelled.
:Lexplore %:p:h
When you are editing deep in a project, opening netrw from the working directory often puts you in the wrong place.
:Man {name}
Neovim ships with a built-in :Man command (the man.
command-line #neovim #navigation #documentation #command-line
:wincmd {key}
:wincmd is the Ex command equivalent of any keystroke.
:tabfind {name}
:tabfind is the tab-aware counterpart to :find.
set path+=**
By adding to Vim's path option, you enable recursive directory search — which makes :find with tab completion a lightweight project-wide fuzzy finder, no plug
:let g:netrw_liststyle=3
Vim ships with a built-in file browser called netrw, opened with :Explore (or :Ex).
:e %:r.html
In Vim's command line, % expands to the current buffer's filename.
command-line #ex-commands #command-line #buffers #navigation
:lvimgrep /pattern/j **/* | lopen
Quickfix is great, but it is global.
:vertical diffsplit {file}
Vim has a built-in diff mode that highlights added, removed, and changed lines between two (or more) buffers.