How do I filter a visual selection through an external shell command?
:'<,'>!command
How it works Vim can pipe selected text through any external shell command, replacing the selection with the command's output.
1019 results for "i" a""
:'<,'>!command
How it works Vim can pipe selected text through any external shell command, replacing the selection with the command's output.
:set suffixesadd+=.js,.ts,.py
In many programming languages, import statements reference modules without file extensions (e.
:set hidden
By default, Vim refuses to let you switch away from a buffer that has unsaved changes, forcing you to save or discard with :w or :e! before moving on.
<C-t> and <C-d>
When you're typing in insert mode and realize the current line needs more or less indentation, you don't have to leave insert mode to fix it.
ds"
The vim-surround plugin provides the ds command to instantly delete any surrounding delimiter pair.
plugins #plugins #surround #editing #text-objects #normal-mode
:vimgrep /pattern/g **/*.ext
The :vimgrep command searches for a pattern across multiple files and loads the results into the quickfix list.
~/.vim/after/ftplugin/{filetype}.vim
Vim's after directory (~/.
:set foldmethod=indent
Setting foldmethod=indent tells Vim to create folds based on the indentation level of each line.
Treesitter incremental selection with grn/grc
nvim-treesitter provides incremental selection that expands based on the syntax tree rather than simple text patterns.
zt / zb
The zt and zb commands scroll the viewport so the current cursor line appears at the top or bottom of the screen respectively, without moving the cursor.
:resize N / :vertical resize N
The :resize and :vertical resize commands set a window to an exact number of lines or columns.
:Telescope live_grep
Telescope's livegrep picker provides real-time regex search across your entire project as you type.
:syntax on
The :syntax on command enables syntax highlighting in Vim, colorizing your code based on the file type.
V
The V (uppercase) command enters visual line mode, which selects the entire current line.
<C-w>c
The c (Ctrl+w then c) command closes the current window without closing the buffer it contains.
:set backupdir=~/.vim/backup// directory=~/.vim/swap//
How it works By default, Vim creates backup files (ending in ~) and swap files (ending in .
:profile
When Vim feels sluggish to start, the built-in :profile command lets you measure exactly how much time each script, function, or plugin takes to load.
gd / gr / <leader>rn with nvim-lspconfig
The Language Server Protocol (LSP) brings IDE-level intelligence to Neovim — go-to-definition, find references, rename symbol, and more.
:set relativenumber
The :set relativenumber command displays line numbers relative to the cursor position instead of absolute line numbers.