to create a text file or opens it
2 modes: insert(only inserts data),escape(press esc)–we can pass through and delete the content
to enter insert mode:
i — from same charactter of cursor pointed
a–from next character of right side from cursor
o(small oh) — new line created below cursor.
O(capital oh) — new line created above cursor.
to save file: come to escape mode and type :w
to quit :q..to write and quit, :wq
to quit wihtout saving changes :q!
In escape mode:
$ will move to end of line.
0(zero) — beginning of the line.
x — deletes a character.
nx — deletes n characters
dw — delete a word
ndw — delete n words
dd — delete the line
ndd — n lines
yy — yonking — copies a line where cursor is placed.
p -paste the copied line beneath the cursor.
similarly nyy — to copy multiple lines.