1ESC? Nothing happens.23CTRL + C? No.45ESC ESC ESC? Nope. I'm stuck.67How to quit?
I don’t know about you, but I’ve been there. Until I decided to spend 10 minutes learning the very basics of Vim. This post is just enough to get you started and do not covers advance !
Vim is there by default with many operating systems (including most Linux distributions and Mac OS X), so , Just launch a terminal and type ‘vim’ to get started.
: why to use vim ?
With some learning, Vim can be more powerful than many graphical IDEs. As it certainly doesn’t eat hundreds of megs of memory just to view an empty file (like in, Eclipse).
Some commands in this guide start with a colon: pressing it will display the command prompt where the subsequent command is written.
Commands written in CAPITAL LETTERS are specific keys: for example, ESC means the escape key on your keyboard.
Commands without a colon are more like hotkeys - they can be used in the Vim default mode (which is the mode Vim starts in).
All commands in Vim are case-sensitive.
a) To start inserting text on the current cursor location:
b) To start inserting at the end of the current line:
c) To exit insert mode, and return to the default mode:
a) To quit, discarding any changes you might have made (before press ESC):
b) To quit, saving any changes you’ve made(before press ESC):
NAVIGATING THE BAR
a) To move to line 285 (before press ESC):
b) To search for the word return(before press ESC):
CUT COPY PASTE
a) To copy the current selection into the buffer (think of it as a clipboard):
b) To cut the current selection:
c) To copy the current line into the buffer:
d) To copy 3 lines including the current line into the buffer:
e) To cut the current line and place it into the buffer:
f) To cut 5 lines including the current line:
UNDO AND REDO
a) To undo the last change:
b) To redo the last change you just undid:
1CTRL + R
SYNTAX HIGHLIGHTING AND INDENTATION
a) Turn on syntax highlighting:
b) Enable automatic indentation:
WORKING WITH MULTIPLE FILES
a) To open new tab of terminal
b) To open server.py in a new tab:
c) To move to the next tab on the right:
e) To move to the previous tab on the left:
a) To open templates/base.html in a vertical split screen:
b) To open shared.js in a horizontal split screen:
c) To move between split screens:
1CTRL + W + ARROW KEYS