VI commands and keys in a unix terminal

xcorpius
xcorpius used Ask the Experts™
on
I can configure the unix terminal executing "set -o vi".
Could you explain me what commands and keys can I use in this enviroment?
Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Top Expert 2013
Commented:
This is a neat HOWTO:

http://www.selectorweb.com/command_line_editing.html

Basically the above article mentions these key bindings:

Command Editing -- Cursor Movement in command mode for vi

l (el)    Move the cursor forward one character
h         Move the cursor back one character
w         Move the cursor forward one word
b         Move the cursor back one word
fc        Find character c in the line
0 (zero)  Cursor to the start of the line
$         Cursor to the end of the line

l, h, w, f and b can be preceded by a number

Command Editing -- Editing keys in command mode for vi

x         Delete the character over the cursor. Can be preceded by a count
X         Delete the character behind the cursor. Can be preceded by a count
~ (tilde) Change case of the character over the cursor. Can be preceded by a
count
u         Undo the last change to the line
U         Undo all changes to the line
a         Enter input mode and begin inserting after the current character
A         Enter input mode and begin inserting at the end of the line
i         Enter input mode and begin inserting before the current character
I         Enter input mode and begin inserting at the beginning of the line

You enter input mode by pressing a, A, i or I. To exit to command mode, press the esc key.


wmp

Author

Commented:
Missing several key combinations that need.
Most Valuable Expert 2013
Top Expert 2013

Commented:
Why didn't you ask for those keys before giving grade B?

Author

Commented:
True, you're right. Sorry

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial