Search This Blog

Friday, December 27, 2013

Powerful VI Editor

The vi editor (short for visual editor) is a screen editor which is available on almost all Unix systems. Once you have learned vi, you will find that it is a fast and powerful editor. vi has no menus but instead uses combinations of keystrokes in order to accomplish commands.

Here are some powerful commands which helps to use vi editor in daily basis:

Note : Using "+" here to indicate that we have to press both the buttons to perform action.

1. Cursor Navigation

j --  next line

k -- previous line

h -- left

l -- right

shift + g -- bottom of document

g + g -- top of document

2. Fast Search

/ -- Search Term

n -- next

N -- previous

3. Command Mode 

: -- enter command mode

:w -- write

:q -- quit  

:e -- open

Esc -- escape command mode

4. From normal to Edit mode

i -- Insert at current position

I -- insert at start of line

A -- append to end of line

o -- Insert line below

O -- Insert line above

5. Clipboard

d+w -- delete word

d+d -- delete line

p -- put after cursor

P -- put before cursor

y+w -- copy word

y+y -- copy line

No comments:

My Profile

My photo
can be reached at 09916017317