Vi
Vi (ausgesprochen [ wi: aI ], aber nicht [ vi: ] und auch nicht "sechs", abgeleitet von der römischen Zahl VI) ist ein von Bill Joy für eine frühe BSD Version geschriebener Texteditor. Der Name stammt von `Visual Interface', weil sein Vorgänger ex ein einfacher Zeileneditor war. Vi wurde schnell zum de facto Standardeditor unter Unix (auch für Hacker), jedenfalls bis zum Aufstieg von Emacs um 1984 herum. Aufgrund seiner Schlankheit startet er schneller und benötigt weniger Speicherplatz als Emacs. Sogar auf einer Rettungsdiskette hat Vi auch heute noch Platz, so dass entweder Vi selber oder einer seiner Klone Bestandteil fast aller Unix-Installationen ist.
Vi tends to frustrate new users to no end, because it is a modal editor. In the command mode, most of the keys are editing commands, such as moving the cursor, deleting text, and so on. In input mode, the user may type in text as expected, with the Escape key exiting this mode. Early versions of vi didn't give any indication as to which mode they were in, and it is typical of users to simply press the Escape key to ensure the editor is in command mode (it will beep if already in command mode). Current versions of vi indicate the mode on the status line or graphically. One advantage of issuing commands in a command mode is that multiple editing operations can be performed in a row with very simple keystrokes, without having to hold down the <Alt>, <Ctrl>, or other special modifier keys. For experienced users, this can lead to faster work.
Nevertheless it is still widely used by users of Unix variants (about half the respondents in a 1991 Usenet poll preferred it), and even Emacs fans often resort to it as a mail editor and for small editing jobs. When a "rescue floppy" is being built for restores following a hard drive crash, vi is often the editor chosen because it is compact enough to fit on a floppy, and because almost anyone performing rescue operations will probably be able to use it. See editor wars.
Dier wichtigsten Vi-Kommandos
vi filename | oeffnet oder erzeugt ein neues file |
<esc>:q! | beenden ohne zu speichern |
<esc>:wq oder <esc>ZZ | speichern und beenden |
<esc> | schaltet in den Befehlsmodus |
i,I,a,A,o,O | schalten in den Eingabemodus |
Befehlsmodus: | |
w | wort vorwaerts |
b | wort zurueck |
x, X | loeschen (vorwaerts - rueckwaerts) |
nx | loesche n Buchstaben |
ndd | loesche n Zeilen |
nD | loesche bis zum Zeilenende |
/regex | suche vorwaerts nach regex |
?regex | suche rueckwaerts |
n | wiederhole Suche |
Siehe auch:
- VIM - "Vi IMproved" - ein deutlicher leistungsfähigerer und benutzerfreundlicherer Klon, mit der Homepage unter www.vim.org.