When you initially begin using Vim, you're probably a bit flustered that you can't just "start typing in text" right from the get go. Well, that's okay, just press the "i" key and you should be all set. Take note of the table below that tells of all the basics of moving and editing in Vim and give them a shot in the editor itself.
i | Allows you to insert text where the cursor is. |
I | Allows you to insert text at the beginning of a line without whitespace |
a | Allows you to insert text at the end of a line. |
o | Allows you to insert text below the current line |
O | Allows you to insert text above the current line |
Esc
|
Exit insert mode
|
j<n> | Move the cursor down< A certain number of lines> |
k<n> |
Move the cursor up < A certain number of lines>
|
dd
|
Delete line
|
d<n>d |
Delete a number of lines [including the one currently selected]
|
gg | Go to the first line |
G | Go to the last line |
g<n>g | Go to a specific numbered line |
x |
Delete Character after cursor
|
X
|
Delete Character before cursor
|
w |
Move an entire word ahead, ignoring spaces [white space]
|
b |
Move an entire word back, ignoring spaces [white space]
|
dw | delete the next word |
db | delete the last word |
d<n>w | delete the next <amount> words |
d<n>b | delete the last <amount> words |
Follow me on twitter! @ehldmnt
No comments:
Post a Comment