How do I keep concealed text hidden while navigating but automatically reveal it when my cursor enters insert mode?
:set concealcursor=nv
The 'concealcursor' option controls in which modes concealed text is revealed on the cursor line.
795 results for "g* g#"
:set concealcursor=nv
The 'concealcursor' option controls in which modes concealed text is revealed on the cursor line.
<C-k>{char1}{char2}
Vim has a built-in digraph system that lets you insert hundreds of special characters by typing two-character mnemonics.
editing #editing #insert-mode #special-characters #unicode #productivity
:put a ... edit ... "ayy
Recorded macros are stored as plain text in registers, but editing them by re-recording is tedious for complex sequences.
v / V / <C-v> (while in visual mode)
When you are already in visual mode and realize you need a different selection type, you do not have to exit and re-enter.
:for i in range(1,10) | execute "normal @q" | endfor
Using a Vimscript :for loop with execute "normal @q" lets you run a macro with a dynamically computed iteration count and interleave other Ex commands between i
<C-w>F
F opens the filename under the cursor in a new horizontal split window and jumps to the line number that follows the filename.
buffers-windows #navigation #buffers-windows #windows #editing
/\%>5c\%<20cpattern
How it works Vim's search patterns support column position constraints using the \%c family of atoms.
:{range} normal @{reg}
The :normal command lets you execute Normal mode keystrokes over a range of lines.
vim.lsp.buf.code_action({ apply = true, filter = function(a) return a.isPreferred end })
When an LSP server marks a code action as isPreferred (e.
:Rename {newname}
vim-eunuch (by Tim Pope) adds Unix shell operations as first-class Vim commands.
<C-a> / <C-x> (vim-speeddating)
vim-speeddating (by Tim Pope) extends Vim's built-in and increment/decrement operators to understand dates, times, roman numerals, and other ordered sequences.
:%!{cmd}
The :%!{cmd} command pipes the entire buffer through an external shell command and replaces the buffer contents with the command's output.
command-line #editing #ex-commands #shell #filtering #productivity
:jumps
How it works Vim keeps a jump list that records your cursor position every time you make a jump.
:[range]normal @q
The :[range]normal @q command replays the macro in register q on every line within a given range.
<C-x><C-i>
Vim's completion mode searches for keyword matches not just in the current buffer, but also in all files reachable via include directives (e.
<C-d> (in command mode)
Pressing in Vim's command line displays the full list of matching completions below the command prompt, without cycling through them one at a time.
command-line #command-line #completion #ex-commands #navigation
vim.fs.root()
vim.
:set autowriteall and autocmd FocusLost * silent! wa
How it works Vim can be configured to automatically save your files when you switch to another window or application.
:set jumpoptions+=view
By default, when you navigate the jump list with (older) or (newer), Neovim restores the cursor's line and column but does NOT restore where the window was scro
as and is
Vim defines sentence text objects — as (around sentence) and is (inner sentence) — that allow any operator to act on an entire sentence in one motion.