Using CheatSheets To Apply Best Practices

Vim CheatSheet

Vim CheatSheet

1.1 Basic Usage

Name Summary
Show help :help
Enter to paste mode :set paste
Put vim to background/foreground C-z; fg
Password protecting file vim +X filename
Install enhanced vim yum install vim-enhance

1.2 Movement

Name Summary
Page down/up C-d / C-b; C-u / C-f
Forward/backward character l, h
Prevous/next line k, Ctrl-p; j, Ctrl-n
Move to next word w/W
Go to the top gg
Go to the bottom G
Go to beginning of the line B
Go to end of the line 0

1.3 Deletion

Name Summary
Delete current word d-w
Delete current line d-d
Delete to the bottom d-G

1.4 Changes

Name Summary
Undo the previous changes In view mode, u
Reload file from disk :e

1.5 Panel

Name Summary
Next panel C-h
Split panel :split
Vertical split panel :vsplit
Change panel size C-w >, C-w <

1.6 Blocks

Name Summary
Copy block shift+v, y
Paste block shift+v, p
Cut block shift+v, x
comment/uncomment block shift+v, gc

1.7 Files

Name Summary
Show current filename :echo @%
Open a new file :edit <filename>

Image credit to http://michael.peopleofhonoronly.com/vim/

1.8 More Resources

License: Code is licensed under MIT License.

linkedin
github
slack




Leave a Reply

Your email address will not be published. Required fields are marked *