vim command is operator 2 mode: normal mode, insert mode.Vim is an editor to create or edit a text file.
Note:
Pressing <ESC> to return Nomarl mode to performing commands the below:
Moving the cursor:
To move the cursor, press key:
h: move left
j: move below
k: move top
l: move right
Motion the curson:
type w to move the cursor words forward
type e to move the cursor to the end of the word forward
type 0 (zero) to move to the start of the line.
Exiting VIM:
press <ESC> key ---> type :q!<ENTER> to not save all changes.
press <ESC> key ---> type :wq<ENTER> to save the changes.
Text editing - insertion:
press i key insert before the cursor
press A key appended text after the line
Deletion commands:
To delete a word, press dw
To delete the character at the cursor type: x
To delete a whole line, type dd
The undo command:
press u key to undo the last commands
press U (capital U) to undo all the changes on a line
type CTRL-R to redo the commands (undo the undo's)
The replace command:
type r key then the character you want EX: type ra to replace the character at the cursor with a
Cursor location and file status:
Type CTRL-G to show your location and file status: type G to move the bottom of file and Type gg to move to the start of the file
The search command:
Type /<a phrase><ENTER> ex /huuphang-->ENTER press.
To search for the same phrase again, type n
To search for thesame phrase in the opposite direction, type N
Matching parentheses search:
type % to find a matching ),], or }. place the cursor on any (,[, or {, then type % character
The substitute command:
To substitute phang for the first huu in a line, type :s/huu/phang
To substitute phang for all 'huu's on a line type :s/huu/phang/g
To substitute phrases between two line #'s type :#,#s/huu/phang/g
To substitute all occurrences in the file type :%s/huu/phang/g
To ask for confirmation each time add 'c' :%s/huu/phang/gc
How to execute an external command:
Type :!<external command> ex: :!ls
Writing files:
type :w filename
Selecting text to write:
move the cursor to line, type v then :w filename
Retrieving and merging files:
To insert the contents of a file, type :r filename
Copyright by: www.linuxoperatingsystem.info http://goo.gl/kMscJ4
Search This Blog
Popular Posts
-
In this articles, how to install and configuration openldap in centos 6 step by step . openldap run 2 port: 389 ( insecure ) and 636 ( secur...
-
Step by step install ibus-unikey on ubuntu 14.10. solve problem Error: "Can’t connect to iBus". Step 1: The first install "...
-
in this articles, lamp ( linux, apache, mariaDB, PHP). how to lamp install on centos 7 ? Step-by-step lamp install on centos 7 below: Ste...
-
How to install Lamp (Apache, MySQL, phpmyadmin) ubuntu 14.10 ? LAMP is short for Linux, Apache, MySQL, PHP. This video tutorial shows how yo...
-
vim command is operator 2 mode: normal mode, insert mode. Vim is an editor to create or edit a text file. Note: Pressing <ESC> t...
-
ls command alongside wildcard metacharacters. in this articles, examples about ls command. Note: Metacharacters Descriptions * M...
-
In this articles, how to nagios installation on centos 7, The Nagios to monitoring for your system such as: CPU load, disk usage,etc. it...
0 comments:
Post a Comment