Vim Demystified

How to exist Vim included

Vim is a text editor .. advanced text editor.
the issue with Vim for first time users is, you can't see anything .. you don't know what to do.
everything is opaque and vague .. even how to write text is not clear.
let's try to demystify Vim a little bit.
To open file using vim just write vim command then file location

vim /home/ubuntu/readme
if file not exist vim will open a new file
you can't stat writing directly
since vim has two modes [insert, command]
the default mode is [command]
in command mode you can execute commands like copy, paste, save, exit and many many more.
in insert mode you can edit the text.
activate insert mode		i
exist insert mode		ESC
The indicator that insert mode is activated is this line at the end of the screen:
-- INSERT --                                                  1,1           All
if you press ESC to enter command mode the above line will disappear

How to Exit Vim:
at any point you decided to exit vim you should first activate command mode by press ESC button in your keyboard.
then you have two options for exit:
exit without save		ESC then  :q!  then enter
exit with save			ESC then  :x  then enter
save without exit		ESC then  :w  then enter
Editing:
Paste [insert mode] 				shift + insert [this will paste text copied from host OS the current file .. working only from putty .. not working from VirtualBox console]

Paste [command mode] 				p [paste text copied from the current file]
delete/cut line [command mode]			dd
Navigation:
go to the end of file 		shift + g
go to the begin of file 	gg
select text [command]
press "v" to start then move cursor to select .. you can select multi liens.
you can press shift + v to select entire line.

if you want to select all press the following sequence:
gg
shift + v
shift + g
Search for text
in command mode press /
then write your search pattern

example:
/invoke_start()
What's Next!
for more peace of mind practice .. go to this site:
http://vimgenius.com
it's interactive Vim practices.
Just complete the intro and level one.
you will like it and you will be familiar with Vim command.


Back To List