Web Page Hosting

Web Hosting | Dedicated Server Hosting| Cpanel Hosting | VPS Hosting | Windows Hosting | Windows Reseller

Basic visual editor Command

March 27th, 2008 by admin

These are the basic of vi editing, you will find quite helpful;

Editing commands

Moving around the file:

h — cursor left

i — cursor right

k — cursor up

j — cursor down

^ & B — Beginning of line

$ — end of line

) — Next sentence

( — Previous sentence

} — Next Paragraph

{ — Previous Paragraph

:$ — end of file

w — one character forward

W — one word forward

:20 — go to Line no 20 or whatever number you give

Displaying file info:

^g — give name of the file, current line and total lines of a file at the bottom.

Inserting and appending text :

i — inserts text to the left of cursor

I — inserts in the beginning of line

a — appends text to right of cursor

A — appends to the end of line

Adding new line:

o — add a new line below the current line

O — adds a new line above the current line.

Deleting the text:

x — deletes text above the cursor

X — deletes text character on the right of cursor

20dd — deletes 20

dd — deletes current line

D — delete till end of current line.

d# — delete to where the # (j,k,l,h) specifies.

d/ — delete till pattern is found (forward).

d? — delete till pattern is found (backward).

d’ — delete till mark ‘char’.

Replacing a character & word:

r — replace the character above the cursor.

R — replces characters until Esc is pressed.

cw — replaces the word from cursor to the end indicated by $ sign.

C — replaces till end of line.

Substitute:

s — subistutes current charcater.

S — substitutes entire line.

Repeating last command:

. — repeats the last text.

Undo the last change:

u — undo last change.
U — undo changes to the current line.

Copy and pasting lines:

yy — copies the current line into buffer.
5yy — copies 5 lines from the current line.
p — pastes the current buffer.

Recovering an unsaved vi file:

vi -r — restores a unsaved / crashed file from buffer.

Searching:

:/name — & return searches for the word name in the file

n — continues search forward.

N — searches backwards.

Substitution:

:s///g

Saving:

:w — saves the text does not quit.

:wq — saves & quit the editor.

ZZ — save & quit the editor.

:q! — Quit without saving.

Miscellaneous:

m — mark this location and name it char.

‘ — (quote character) return to “line” named char.

` — (back-quote character) return to “place” named char.

‘’ or “ — (quote quote) return from last movement.

These commands allow the vi editor screen (or window) to move up or down several lines and to be refreshed.
^f move forward one screen
^b move backward one screen
^d move down (forward) one half screen
^u move up (back) one half screen
^l redraws the screen
^r redraws the screen, removing deleted lines

Posted in Hosting tools | No Comments »


A special offer from Micfo for New signups. Dedicated Web Hosting VPS Web Hosting Coupon Code: Raidx-micfovps Get a recurring 10 % discount on every new VPS Hosting Signup. Dedicated Web Hosting Coupon Code: Raidx-micfodedicated Get one time 5% discount on any Micfo Dedicated Server Hosting package.

  • Web Hosting Blogroll


    Windows Hosting
    Windows Shared Hosting

    VPS Hosting
    VPS Hosting plans

    Dedicated Server Hosting
    Dedicated Server plans

    Business Web Hosting
    100% uptime Hosting

    Cpanel Hosting
    cPanel Shared Hosting

    Reseller Hosting
    Reseller Web Hosting

    Windows Reseller Hosting
    Windows Reseller Hosting

    Windows VPS
    Windows VPS Hosting

    Archives

     

    July 2009
    M T W T F S S
    « Mar    
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  

    Categories

    Blogroll

    Meta

    Recent Comments

      Pages

      Recent Posts

      Tags

      Search Posts