How do I open a Telescope picker result in a split or new tab instead of the current window?
<C-x> / <C-v> / <C-t> (in Telescope)
When browsing results in a Telescope picker, you are not limited to opening selections in the current window.
2125 results for "i" a""
<C-x> / <C-v> / <C-t> (in Telescope)
When browsing results in a Telescope picker, you are not limited to opening selections in the current window.
:e %:h/
Vim expands % to the current file's path in Ex commands, and the :h modifier strips the last filename component to give you just the directory.
:%s/\d\+/\=submatch(0)+1/g
Vim's expression replacement (\=) in substitutions lets you perform arithmetic on matched text.
:let @q .= 'A;<Esc>'
Re-recording a long macro just to add one extra step is slow and error-prone.
:g/pattern/d A
Using :g/pattern/d A you can sweep through the entire buffer and extract every line that matches a pattern into register a, removing them from the buffer in the
diw
The diw command deletes the inner word under the cursor.
nnoremap <key> :<C-u>call MyFunc(v:count)<CR>
When writing custom mappings that call Vimscript functions, a common pitfall is that any count you type before the key (e.
<C-v>$A
When you need to append text to the end of several lines that have different lengths, visual block mode with $ is the key.
\%[abc]
The \%[.
5@q
Prefix the @ macro-execution command with a count to run the macro that many times in a row.
:let @/ = "pattern"
Assigning a string directly to the search register @/ with :let causes Vim to highlight all matches (if hlsearch is enabled) without performing a search or movi
:'<,'>normal @a
The :'normal @a command executes the macro stored in register a on every line within the current visual selection.
:.!{cmd}
:.
:vert {cmd}
Vim's :vertical modifier (abbreviated :vert) can be prepended to any Ex command that opens a split window to make it open as a vertical split instead of a horiz
buffers-windows #buffers-windows #windows #splits #ex-commands
mA
Uppercase marks (A–Z) are global marks in Vim — they persist across files and even across sessions (when viminfo or shada is configured).
ciw + new text + Esc, then n.
The ciw command followed by new text, combined with and .
qaciw"<C-r>""<Esc>wq
This macro wraps the current word in double quotes by changing the word, inserting quotes around the original content, and moving to the next word.
:let @q =
Instead of recording a macro with q, you can assign any string directly to a named register using :let @{register} = 'keys'.
:let @/ = @"
After yanking text, you can promote it directly to the search register with :let @/ = @".
<C-w>H and <C-w>K
After opening a split you can dynamically reposition windows using H, J, K, and L.
buffers-windows #windows #buffers-windows #navigation #normal-mode