How do I set up oil.nvim to manage files using Vim's full editing power including macros and visual selections?
stevearc/oil.nvim
oil.
stevearc/oil.nvim
oil.
<C-r><C-o>
When you paste a register in insert mode with {reg}, Vim inserts the text as if you had typed it — which means auto-indent, abbreviation expansion, and other
registers #registers #insert-mode #paste #autoindent #editing
vim.diagnostic.jump()
Neovim 0.
vim.ui.select() and vim.ui.input()
Neovim provides vim.
vim.uv.new_timer()
Neovim exposes vim.
vim.lsp.completion.enable()
Neovim 0.
vim.snippet.expand()
Neovim 0.
:g/pattern1/g/pattern2/command
Vim's :g command can be nested — the command part of one :g can itself be another :g.
\%[seq]
Vim's \%[seq] atom makes the sequence seq optional in a pattern — matching any prefix of the sequence (including nothing).
g<C-g> (visual mode)
In visual mode, pressing g reports detailed statistics for the selected text only — word count, character count, and byte count.
dgn
The gn motion is a versatile text object that selects the next occurrence of the last search pattern.
editing #editing #search #text-objects #normal-mode #motions
:saveas {newname}
:saveas saves the buffer to a new file and redirects all future :w commands to write to that new filename — making it the true "Save As" command in Vim.
g??
Vim has a built-in ROT13 operator g? that encodes text by rotating each letter 13 positions in the alphabet.
:%s/^\(.\+\)\n\1$/\1/
This substitute command detects pairs of identical adjacent lines and collapses them into one, using a back-reference to match the repeated content.
:put =''
Using :put ='' with an empty expression lets you insert blank lines in normal mode without ever entering insert mode.
editing #editing #normal-mode #ex-commands #expression-register #blank-line
cgn...{text}<Esc>.
The cgn + .
:'<,'>normal {command}
After making a visual selection, :'normal {command} runs any normal-mode command on each selected line individually.
<C-x><C-n>
triggers keyword completion that searches only the current buffer for matches, scanning forward from the cursor.
mode()
The mode() function returns a short string identifying the current editing mode — 'n' for Normal, 'i' for Insert, 'v' for Visual character-wise, 'V' for Visua
macros #macros #normal-mode #visual-mode #insert-mode #editing
shellescape({expr})
The shellescape() function wraps a string in shell-safe quoting, escaping any special characters so it can be embedded in a shell command constructed with :exec
command-line #ex-commands #command-line #editing #normal-mode