Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: VIM text editor  (Read 1531 times)

0 Members and 1 Guest are viewing this topic.

alanj

  • Guest
VIM text editor
« on: July 18, 2017, 05:29:36 pm »
VI editor has three modes of operations

   - Command Mode
   - Insert mode
   - Ex Mode (Extended Command Mode)

Insert Mode
-----------------------------

I – Insert the text at the current cursor position.
l – Insert the text in beginning of a line
a – Adds the text after the current cursor position
A – Adds the text at the end of a line
o – Insert the text one line below current cursor position
O – Insert the text one line above current cursor position

Ex mode
---------------------------------------

:q – Quit without saving
:q! – Quit forcefully without saving
:w – Write (save)
:wq – Save and quit
:wq! – Save and quit forcefully
:se nu – sets line numbers
:se nonu– Remove line numbers
:84 – The cursor goes to line 84

Command Mode
--------------------------------------

dd – Deletes a line
ndd – Deletes ‘n’ lines
yy – Copies a line
nyy – Copies ‘n’ lines
p – Put (pastes the deleted or copied text)
u – Undo(you can undo 1000 times)
G – Moves the cursor to the last line of the file