Differences
This shows you the differences between two versions of the page.
|
wiki:software:unix_systems:vi [2008/12/02 08:36] Tomas Ratkus created |
wiki:software:unix_systems:vi [2008/12/02 10:17] (current) Tomas Ratkus h1ed |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== The Vi Editor ====== | ||
| + | |||
| + | The vi editor is a display-oriented text editor. It is used for creating text files. It is not used to create font formatting. It is not a mode-less editor (as common on modern PCs). Everything that you type does not necessarily appear on the screen. Vi has two modes, editing and command mode. Editing is used for data entry, while command is used to navigate and manipulate the data entered during the editing mode. | ||
| + | |||
| + | ===== Basic navigation ===== | ||
| + | |||
| + | ^command ^effect^ | ||
| + | |h |move left one space| | ||
| + | |j |move down one space| | ||
| + | |k |move up one space| | ||
| + | |l |move right one space| | ||
| + | |w |move forward to the beginning of the next word| | ||
| + | |e |move forward to the end of the next word| | ||
| + | |b |move back to the beginning of the previous word| | ||
| + | |$ |go to the end of the line| | ||
| + | |<nowiki>^</nowiki> |go to the beginning of the line| | ||
| + | |||
| + | ===== Basic Editing ===== | ||
| + | |||
| + | ^command ^effect^ | ||
| + | |i |insert at current location| | ||
| + | |a |append after current space| | ||
| + | |x |delete characters from the right of the current space| | ||
| + | |dd |delete the current line| | ||
| + | |||
| + | ===== Search & Replace ===== | ||
| + | |||
| + | ^command ^effect^ | ||
| + | |:g/123/s//321/g |replace all occurrances of "123" with "321"| | ||
