Show Menu
Cheatography

Personal VIM Cheat Sheet by

My personal vim reference. Includes commands specific to my config.

Movement

<le­ade­r>nc
Next consol­e.log
<le­ade­r>pc
Previous cl
 

vim-mu­lti­ple­-cu­rsors

C-n
start multic­ursor and add a virtual cursor + visual selection on the match
C-n
- add a new virtual cursor
+ visual selection on the next match
C-x
- skip the next match
C-p
- remove current virtual cursor
+ visual selection and go back on previous match
A-n
start muticursor and directly select all matches

vim-su­rround

It's easiest to explain with examples. Press
cs"'
inside

"­Hello world!­"

to change it to

'Hello world!'

Now press
cs'<q>
to change it to

<q>­Hello world!­</q>

To go full circle, press
cst"
to get

"­Hello world!­"

To remove the delimiters entirely, press
ds"
.

Hello world!

Now with the cursor on "­Hel­lo", press
ysiw]
(
iw
is a text object).

[Hello] world!

Let's make that braces and add some space (use
}
instead of
{
for no
space):
cs]{


{ Hello } world!

Now wrap the entire line in parent­heses with
yssb
or
yss)
.

({ Hello } world!)

Revert to the original text:
ds{ds)


Hello world!

Emphasize hello:
ysiw<e­m>


<em­>He­llo­</e­m> world!

Finally, let's try out visual mode. Press a capital V (for linewise
visual mode) followed by
S<p class=­"­imp­ort­ant­">
.

<p class=­"­imp­ort­ant­">
<em­>He­llo­</e­m> world!
</p>
   
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          VI Editor Cheat Sheet
          Vim NERDTree Cheat Sheet
          VIM and Plugins Cheat Sheet