vim

A vim cheatsheet different to everyone else. It is a mindmap cheatsheet. It is still a draft.

Get Started. It's Free
or sign up with your email address
Rocket clouds
vim by Mind Map: vim

1. Insert mode

1.1. paste

1.1.1. ^R,"

1.2. change to normal mode

1.2.1. esc

2. Normal Mode

2.1. paste (put)

2.1.1. after

2.1.1.1. p

2.1.1.2. and move the cursor after the new text

2.1.1.2.1. gp

2.1.1.3. from register 'x'

2.1.1.3.1. pux

2.1.2. before

2.1.2.1. P

2.1.2.2. and move the cursor after the new text

2.1.2.2.1. gP

2.1.2.3. from register 'x'

2.1.2.3.1. pu!x

2.1.3. prepend "x to use register 'x'

2.2. quit

2.2.1. :q

2.2.2. without saving

2.2.2.1. :q!

2.2.3. and save

2.2.3.1. :wq

2.2.3.2. :x

2.2.3.3. ZZ

2.3. edit file

2.3.1. the same file

2.3.1.1. :e

2.3.2. :e {filename}

2.4. delete

2.4.1. under and after the cursor

2.4.1.1. x

2.4.2. before the cursor

2.4.2.1. X

2.4.3. acordding to {motion}

2.4.3.1. d{motion}

2.4.4. line

2.4.4.1. dd

2.4.5. until end of line

2.4.5.1. D

2.5. replace

2.5.1. character under the cursor

2.5.1.1. r{new_char}

2.5.2. entering Insert Mode

2.5.2.1. R

2.6. switch case

2.6.1. and move cursor right

2.6.1.1. ~

2.6.2. acordding to {motion}

2.6.2.1. g~{motion}

2.7. substitute

2.7.1. expression

2.7.1.1. :[range]s:{pattern}:{string}:[options]

2.7.2. modifiers

2.7.2.1. options

2.7.2.1.1. confirm

2.7.2.1.2. ignore errors

2.7.2.1.3. replace all occurrences in the line

2.7.2.1.4. ignore pattern case

2.7.2.1.5. don't ignore pattern case

2.7.2.1.6. print the line containing the last substitution

2.7.2.2. range

2.7.2.2.1. entire document

2.7.2.2.2. last line of document

2.7.2.2.3. line number

2.7.2.2.4. mark

2.7.2.2.5. between {a} and {b} ranges

2.8. copy (yank) text

2.8.1. according to {motion}

2.8.1.1. y{motion}

2.8.2. line

2.8.2.1. yy

2.8.2.2. Y

2.8.3. prepend "x to use register 'x'

2.9. registers

2.9.1. select

2.9.1.1. "{register}

2.9.2. view

2.9.2.1. :reg

2.10. most of this actions can be prepended by a [count]

2.10.1. what is this [count] ?

2.10.1.1. Is the number of times the action will be repeated, unless otherwise noticed.

2.11. change to insert mode

2.11.1. appending

2.11.1.1. at current position

2.11.1.1.1. a

2.11.1.2. at end of the line

2.11.1.2.1. A

2.11.2. inserting

2.11.2.1. in current position

2.11.2.1.1. i

2.11.2.2. on start of the line

2.11.2.2.1. I

2.11.2.3. on new line

2.11.2.3.1. below

2.11.2.3.2. above

2.11.3. replacing

2.11.3.1. R

2.12. undo

2.12.1. u

2.12.2. :u

2.12.3. all changes on the line

2.12.3.1. U

2.13. redo

2.13.1. ^R

2.13.2. :r

2.14. repeat

2.14.1. last change

2.14.1.1. .

2.15. move

2.15.1. up

2.15.1.1. k

2.15.2. down

2.15.2.1. j

2.15.3. left

2.15.3.1. h

2.15.4. right

2.15.4.1. l

2.15.5. to first char of line

2.15.5.1. 0

2.15.5.2. non blank

2.15.5.2.1. ^

2.15.6. to last char of line

2.15.6.1. $

2.15.7. to char

2.15.7.1. forward

2.15.7.1.1. f

2.15.7.1.2. and place the cursor on left

2.15.7.2. backward

2.15.7.2.1. F

2.15.7.2.2. and place the cursor on left

2.15.7.3. repeat latest move

2.15.7.3.1. forward

2.15.7.3.2. backward

2.15.8. to line [count]

2.15.8.1. G

2.15.8.2. gg

2.15.9. by

2.15.9.1. words

2.15.9.1.1. forward

2.15.9.1.2. backward

2.15.9.1.3. what are they?

2.15.9.2. WORDS

2.15.9.2.1. forward

2.15.9.2.2. backward

2.15.9.2.3. what are they?

2.15.9.3. sentences

2.15.9.3.1. forward

2.15.9.3.2. backward

2.15.9.4. paragraphs

2.15.9.4.1. forward

2.15.9.4.2. backward

2.16. marks

2.16.1. set

2.16.1.1. m{a-zA-Z}

2.16.2. go to

2.16.2.1. `{mark}

2.16.2.2. first non blank char

2.16.2.2.1. '{mark}

2.16.3. list

2.16.3.1. :marks

2.17. search

2.17.1. forward

2.17.1.1. /{pattern}

2.17.1.2. latest pattern

2.17.1.2.1. /

2.17.1.3. and go {offset} lines up or down

2.17.1.3.1. /{pattern}/{offset}

2.17.1.4. word nearest to cursor

2.17.1.4.1. *

2.17.2. backwards

2.17.2.1. ?{pattern}

2.17.2.2. latest pattern

2.17.2.2.1. ?

2.17.2.3. and go {offset} lines up or down

2.17.2.3.1. ?{pattern}?{offset}

2.17.2.4. word nearest to cursor

2.17.2.4.1. #

2.17.3. repeat

2.17.3.1. n

2.17.3.2. opposite direction

2.17.3.2.1. N

2.18. macro

2.18.1. record

2.18.1.1. start

2.18.1.1.1. q{letter}

2.18.1.2. end

2.18.1.2.1. q

2.18.2. apply

2.18.2.1. @{letter}

2.18.2.2. last applied macro

2.18.2.2.1. @@

2.19. execute

2.19.1. global

2.19.1.1. :g/{pattern}/{comands}

2.19.1.2. not matching {pattern}

2.19.1.2.1. :v/{pattern}/{comands}

2.20. re-indent

2.20.1. =

2.20.2. most useful with visual mode