tricky
[!TIP|label:references:]
mode
diff mode
diff mode[!NOTE|label:references:]
example
terminal mode
terminal mode[!NOTE|label:references:]
Options: 'modified', 'scrollback'
Highlight groups: hl-TermCursor, hl-TermCursorNC
<empty>: normal buffer
acwrite: buffer will always be written withBufWriteCmds
help: help buffer (do not set this manually)
nofile: buffer is not related to a file, will not be written
nowrite: buffer will not be written
quickfix: list of errors:cwindowor locations:lwindow
terminal:terminal-emulatorbuffer
prompt: buffer where only the last line can be edited, meant to be used by a plugin, see |prompt-buffer|
usage:
open
topcommand line in vsplit
shortcuts
combine multiple lines with or without space
with space:
Jwithout space:
gJor:j!

gcw
capitalize word (from cursor position to end of word)
gcW
capitalize WORD (from cursor position to end of WORD)
gciw
capitalize inner word (from start to end)
gciW
capitalize inner WORD (from start to end)
gcis
capitalize inner sentence
gc$
capitalize until end of line (from cursor postition)
gcgc
capitalize whole line (from start to end)
gcc
capitalize whole line
{Visual}gc
capitalize highlighted text
[!NOTE|label:references:]
lowercase
uppercase
reverse
more
g~3w: toggle case of the next three wordsg~$: toggle case to the end of lineg~iw: toggle case of the current word (inner word – cursor anywhere in word)g~~==g~g~: toggle case of the current line (same as V~ - cursor anywhere in the line)gUU==gUgU: to uppercase of the current line (same as V~ - cursor anywhere in the line)guu==gugu: to lowercase of the current line (same as V~ - cursor anywhere in the line)
counter
[!NOTE|label:references]

insert vim expression
i/I/a/A/o/Oto insert modectrl + r + = to insert expression
ctrl + r> + " ( ⌘ + v ) to insert the contents of the default register
enter

batch insert vim expression
[!NOTE|label:references:]
or
~/.vimrc

commands
[!NOTE|label:references:]

[!NOTE|label:reference:]
CMD
ignorecase
smartcase
MATCHES
foo
off
-
foo
foo
on
-
foo Foo FOO
foo
on
on
foo Foo FOO
Foo
on
on
Foo
Foo
on
-
foo Foo FOO
\cfoo
-
-
foo Foo FOO
foo\C
-
-
foo

search with \V
/a.k.a<CR>
backward a.k.a
/a\.k\.a<CR>
backward a.k.a
/Va.k.a<CR>
backward a.k.a
search in visual mode
[!NOTE]
vgo to visual mode/KEYWORDSsearch next KEYWORDS |?KEYWORDSsearch previous KEYWORDSenter

[!NOTE|label:references:]
sort

sort lines sort and unique

sort lines
or
or and use:
for f in GetFiletypes() | echo f | endfor
redirect cmd
[!NOTE|label:references:]
redir to file
to new window
to TabMessage
[!NOTE|label:references:]

insert hex code
statusline %B
native support
only shows current cursor position
char2nr()
batch processing capability
requires manual handling of encoding ranges
:ascii
displays complete encoding info
requires parsing multi-line output
using :g /./ :ascii

with function
[!NOTE|label:references:] performance:
:ascii
~1.2s
exactly matches the official format
slow
char2nr()
~0.03s
fast
requires custom format
hybrid
~0.5s
balancing speed and format
requires custom format
format json in vim
[!NOTE|label:references:]
multiple repalce in silent mode
replace
force the
bufdoto continue without saving files via:bufdo!
close buffer when close window
commands
autocmd
switch in buffers
next buffer: ctrl + ^
previous buffer: ctrl + 6
first:
:1b<CR>last:
:$b<CR>
show ascii under cursor
[!NOTE|label:references:]
keyboard
ga
commands

open vim with specific line Number
[!NOTE|label:reference]
jumplist
[!TIP|label:tips:]
:help ''`:help ```
relative path:ctrl + g or
print full path
encryption with Vim
encrypt
decrypt
open vim with specific commands
[!NOTE|label:references:]
using vim to format git commit message
config
get platform
[!NOTE|label:references:]
disable vim beep
pastetoggle
[!NOTE|label:references:]
:set paste:set nopaste:set pastetoggle=<F2>details
When the 'paste' option is switched on (also when it was already on):
mapping in Insert mode and Command-line mode is disabled
abbreviations are disabled
'autoindent' is reset
'expandtab' is reset
'hkmap' is reset
'revins' is reset
'ruler' is reset
'showmatch' is reset
'smarttab' is reset
'softtabstop' is set to 0
'textwidth' is set to 0
'wrapmargin' is set to 0
'varsofttabstop' is made empty These options keep their value, but their effect is disabled:
'formatoptions' is used like it is empty
run vim commands in terminal
[!NOTE|label:manual:]
additional highlight
reference:
overview of multi items
/star
*
\*
0 or more (as many as possible)
/\+
\+
\+
1 or more (as many as possible)
/\=
\=
\=
0 or 1 (as many as possible)
/\?
\?
\?
0 or 1 (as many as possible)
/\{
\{n,m}
\{n,m}
n to m (as many as possible)
\{n}
\{n}
n exactly
\{n,}
\{n,}
at least n (as many as possible)
\{,m}
\{,m}
0 to m (as many as possible)
\{}
\{}
0 or more (as many as possible. same as *)
/\{-
\{-n,m}
\{-n,m}
n to m (as few as possible)
\{-n}
\{-n}
n exactly
\{-n,}
\{-n,}
at least n (as few as possible)
\{-,m}
\{-,m}
0 to m (as few as possible)
\{-}
\{-}
0 or more (as few as possible)
overview of ordinary atoms
/^
^
^
start-of-line (at start of pattern) /zero-width
/\^
\^
\^
literal '^'
/\_^
\_^
\_^
start-of-line (used anywhere) /zero-width
/$
$
$
end-of-line (at end of pattern) /zero-width
/\$
\$
\$
literal '$'
/\_$
\_$
\_$
end-of-line (used anywhere) /zero-width
/.
.
\.
any single character (not an end-of-line)
/\_.
\_.
\_.
any single character or end-of-line
/\<
\<
\<
beginning of a word /zero-width
/\>
\>
\>
end of a word /zero-width
/\zs
\zs
\zs
anything, sets start of match
/\ze
\ze
\ze
anything, sets end of match
/\%^
\%^
\%^
beginning of file /zero-width E71
/\%$
\%$
\%$
end of file /zero-width
/\%V
\%V
\%V
inside Visual area /zero-width
/\%#
\%#
\%#
cursor position /zero-width
/\%'m
\%'m
\%'m
mark m position /zero-width
/\%l
\%23l
\%23l
in line 23 /zero-width
/\%c
\%23c
\%23c
in column 23 /zero-width
/\%v
\%23v
\%23v
in virtual column 23 /zero-width
every 3rd

regex every third the 3rd

regex every third
characters
[!NOTE|label:references:]
(none)
decimal
3
255
-
o or O
octal
3
377
(255)
x or X
hexadecimal
2
ff
(255)
u
hexadecimal
4
ffff
(65535)
U
hexadecimal
8
7fffffff
(2147483647)
show all digraphs
[!NOTE|label:references:]
insert unicode
via hex
[!NOTE|label:references:]
i.e.:
steps:
esc : return to normal mode ( optional )
i || o || a || ... : insert mode
ctrl + v
insert
u2b38oru2911: 4 digits usingu

i_ctrl-v u emoji
1F926: 🤦 : Face Palm Emojisteps:
esc : return to normal mode ( optional )
i || o || a || ... : insert mode
ctrl + v
insert
U2b38orU2911: >4 digits usingU

i_ctrl-v U
via digraph char
[!NOTE|label:refrences:]
i.e.:
3c ㈢ 128344c ㈣ 128355c ㈤ 12836steps:
esc : return to normal mode ( optional )
i || o || a || ... : insert mode
ctrl + k
insert
3cor4cor5c

micro
[!NOTE|label:references:]
stop macro at the end of line

others
[!NOTE|label:references:]
[!NOTE|label:references:]
binary mode by
-bbinaryontextwidth0modelineoffexpandtaboff
or
comments
[!NOTE|label:references:]
statueline
[!NOTE|label:references:]
sample
ctags
[!NOTE|label:references:]
Last updated
Was this helpful?