How do I run a normal mode command that bypasses all user-defined key mappings?
:norm!
The :normal! command (abbreviated :norm!) executes a sequence of Normal mode keystrokes while completely ignoring user-defined mappings and abbreviations.
:norm!
The :normal! command (abbreviated :norm!) executes a sequence of Normal mode keystrokes while completely ignoring user-defined mappings and abbreviations.
\&
Vim's \& operator is the AND combinator in a search pattern.
:set nrformats
The nrformats option tells Vim how to interpret numbers when you press (increment) or (decrement).
\C in search pattern
Adding \C anywhere in a search pattern forces case-sensitive matching for that search, overriding the global ignorecase setting.
+ and -
The + and - motions jump to the first non-blank character of the next or previous line respectively — combining vertical movement and ^ into a single, count-a
gr{char}
The gr{char} command is Vim's virtual replace variant of r{char}.
[<C-d>
Vim's [ command jumps to the first definition of the macro or identifier under the cursor, searching from the beginning of the current file and through any file
set nrformats+=alpha
By default, Vim's and commands only increment and decrement numbers (decimal, hex, binary).
]# and [#
Vim provides the ]# and [# motions specifically for navigating C preprocessor conditionals.
set nrformats-=octal
By default, Vim treats numbers prefixed with a leading zero (like 007) as octal when you use or to increment or decrement them.
:stopinsert
:stopinsert is an Ex command that immediately exits insert (or replace) mode and returns to normal mode.
command-line #insert-mode #ex-commands #autocommands #normal-mode
:g/./norm @q
Combining the :global command with :normal lets you run a macro on every non-blank line in one shot.
:let @q = 'keystrokes'
You can assign a string directly to any register using :let, turning it into a macro instantly.
:silent! %normal @q
Combining :silent!, the % range, and :normal @q gives you a powerful pattern for applying a macro across an entire file while gracefully skipping lines that don
:0put
The :put Ex command inserts register contents as a new line below the specified line number.
v:count1
The v:count1 variable holds the count typed before a command, defaulting to 1 if no count was given.
:set showcmd
The showcmd option makes Vim display the currently-typed command in the bottom-right corner of the screen, giving you live feedback as you build up key sequence
:w !cmd
The :w !cmd command sends the buffer's contents as standard input to an external command without modifying the buffer.
ea
The ea compound shortcut moves to the last character of the current word with e, then enters insert mode after the cursor with a.
do
The do command (diff obtain) is shorthand for :diffget.