Apart from the basics, which you should know to use vim, there are many useful commands that I always forget, and every time I need to search on Internet.
Here's my very little cheat sheet.
Enabling/Disabilng row numbers:
:set number :set nonumber
Enabling/Disabling Syntax Highlighter:
:syntax on :syntax off
Text search tips (where "text" is the text to search)
search forward: /text search backward: ?text search case insensitive: /\\ctext
Search and replace (OLD to NEW):
First occurrence on current line: :s/OLD/NEW Globally (all) on current line: :s/OLD/NEW/g Between two line 123 and 345: :123,345s/OLD/NEW/g Every occurrence in file: :%s/OLD/NEW/g
Move to the top and to the end of the file:
move to the top of the file: :0 move to line 123 of the file: :123 move to the end of the file: :$
Maybe some new tricks will be added. (Post your suggestions in comments!)
One Response to “Very essential Vim cheat sheet”
Leave a Reply
Search
Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jul | Sep » | |||||
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | ||||||
Archives
Categories
- Android (3)
- Apple (26)
- Books (7)
- Eclipse (14)
- Errors (3)
- Firefox (7)
- Git (2)
- Hardware (16)
- Horror Code (8)
- Internet (18)
- Java (98)
- JavaScript (9)
- Life, universe and everything (45)
- Lifehacks (25)
- Linux (50)
- Opinions (25)
- OSX (4)
- Python (1)
- Software (27)
- Speeches and Conferences (8)
- Unix (3)
- Web (21)
- Windows (19)
Tag Cloud
Android apple architecture Bash colors configuration CSS Development Düsseldorf Eclipse germany Git Google Hardware hdr How-To Java JAXB job junit Karmic Linux MacBook music night Open Source Opinion oracle OSX patterns Pitfalls Practices Resume Security Software Suspend TDD Testing tip tonemapped Tricks Ubuntu video Web XML
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
Blog License
Blogs I like
Books on the desk
Friends' Blogs
- Antonio Terreno & Valter Bernardini
- Bruno Bossola
- Daniele Galluccio
- Domenico Ventura
- Ed Schepis
- Fabrizio Gianneschi
- Luca Grulla
- Luigi Zanderighi
- Marcello Teodori
- Mida Boghetich
- Muralidharan Chandrasekaran
- Piero Ricca
- Renzo Borgatti
- Simone Bordet
- Simone Bruno
- Uberto Barbini
- Valvolog
- Webtide blogs (Greg Wilkins & Jan Bartel)
Links




















How about:
move to a specific line number:
G (e.g. 35G jumps to line 35)