Tuesday, January 10, 2017

Terminal and vi quick navigation commands



Terminal shortcuts :


Ctrl + L  clear screen
Ctrl + D logout
Ctrl + A cursor to start of the line
Ctrl + E cursor to End of the line
Ctrl + U Delete left of the cursor
Ctrl + K Delete right of the Cursor
Ctrl + W Delete word on the left of cursor
Ctrl + Y Paste


Vi shortcuts

Insert text :

i Insert before cursor
I Insert before line
a Append after cursor
A Append after line
o Open new line after current line
O open new line before current line

Cursor move:

0 Takes to starting of the line
$ Takes to End of the line
w Move to next word
b Move to the beginning of the word
e Move to end of the word
( Move a sentence back
) Move a sentence forward 
1G Move to the first line of the file
G Move to last line of the file


Deleting Text :

x Delete character to right of the cursor
X Delete character to left of the cursor
D Delete to end of the line