Vi: Difference between revisions
Content added Content deleted
(Created page with "VI (for "visual editor") is a text editor for "plain text". It is the standard-editor on most Unix-systems. There are several variants: * [[wp:Elvis (text editor)|E...") |
(wp:Category:Unix text editors / Command-Summary) |
||
Line 1: | Line 1: | ||
[[wp:vi|VI]] (for "visual editor") is a text editor for "plain text". |
[[wp:vi|VI]] (for "visual editor") is a text editor for "plain text". |
||
It is the standard-editor on most Unix-systems. |
It is the [[wp:Category:Unix text editors|standard-editor]] on most Unix-systems. |
||
The current versions have almost everything you can expect from an editor: |
|||
scripting, macro-recording, syntax-coloring, UTF-8, Unicode, GUI etc. |
|||
However, the basic concept is quite old, e.g. it also has an '''ex'''-mode |
|||
that was designed to work with old teletype-devices. |
|||
There are several variants: |
There are several variants: |
||
⚫ | |||
* [[wp:Elvis (text editor)|Elvis]] |
* [[wp:Elvis (text editor)|Elvis]] |
||
* [[wp:nvi|nvi]] - "new vi" |
* [[wp:nvi|nvi]] - "new vi" |
||
* [[wp:vile (editor)|vile]] - "VI Like Emacs" |
* [[wp:vile (editor)|vile]] - "VI Like Emacs" |
||
* [[wp:Vim (text editor)|vim]] - "vi-improved" |
* [[wp:Vim (text editor)|vim]] - "vi-improved" [http://www.vim.org VIM] current version: Vim 7.4.507 |
||
⚫ | |||
==Command-Summary== |
|||
'''Usage:''' vi file.txt |
|||
There is a "normal" mode that acts as command-mode, and an insert-mode: |
|||
<pre> |
|||
i - insert text at cursor-position |
|||
a - append text at end-of-line |
|||
ESC - abort command, i.e. end insert-mode, and return to normal/commandmode. |
|||
hjkl - move cursor: left/down/up/right (use with count: "5k" move 5 lines up ) |
|||
Cursor-keys should work as well |
|||
/abc/ - find text "abc" |
|||
. - repeat last command (e.g. the last find) |
|||
x - delete char ( use with count: "5x" deletes 5 char ) |
|||
dd - delete line ( dito: "2dd" deletes 2 lines ) |
|||
u - undo |
|||
: is the prefix for commands: |
|||
:33 - move to line 33 |
|||
:r file2.txt - read: insert contents of file2 at current position |
|||
:w - write current file ( :w! to force it ) |
|||
:q - quit ( :q! to force it ) |
|||
</pre> |
|||
[[Category:Editor]] |
[[Category:Editor]] |
Revision as of 03:05, 11 November 2014
VI (for "visual editor") is a text editor for "plain text". It is the standard-editor on most Unix-systems.
The current versions have almost everything you can expect from an editor: scripting, macro-recording, syntax-coloring, UTF-8, Unicode, GUI etc.
However, the basic concept is quite old, e.g. it also has an ex-mode that was designed to work with old teletype-devices.
There are several variants:
- BusyBox - includes a tiny vi clone
- Elvis
- nvi - "new vi"
- vile - "VI Like Emacs"
- vim - "vi-improved" VIM current version: Vim 7.4.507
Command-Summary
Usage: vi file.txt
There is a "normal" mode that acts as command-mode, and an insert-mode:
i - insert text at cursor-position a - append text at end-of-line ESC - abort command, i.e. end insert-mode, and return to normal/commandmode. hjkl - move cursor: left/down/up/right (use with count: "5k" move 5 lines up ) Cursor-keys should work as well /abc/ - find text "abc" . - repeat last command (e.g. the last find) x - delete char ( use with count: "5x" deletes 5 char ) dd - delete line ( dito: "2dd" deletes 2 lines ) u - undo : is the prefix for commands: :33 - move to line 33 :r file2.txt - read: insert contents of file2 at current position :w - write current file ( :w! to force it ) :q - quit ( :q! to force it )