VIXEN(1) VIXEN(1) NAME vixen - vi-like text editor SYNOPSIS wm/vixen [ -d debug ] [ -c macro ] [ -i ] path DESCRIPTION Vixen is a vi-like text editor for Inferno. Options Vixen edits path, or a new buffer if no path is given. If path is a directory, nothing is read. -d debug Print debug messages to standard error. Each character in debug enables debug printing for functionality asso- ciated with that character ( `a-z' only). See the source code for the mapping of character to functional- ity. As a special case, `+' enables all debug print- ing. -c macro After startup, before giving control to the user, macro is executed. -i Reads initial buffer from standard input instead of from file. This can be used to start vixen with a directory as filename and pipe the output of a command to it. Modes Vixen is a modeful text editor. It starts in command mode, interpreting key strokes as commands. Commands can move the insertion cursor, modify the buffer, change the mode, and more. Many commands that modify the buffer expect to be followed by a motion commands, causing the command to oper- ate on text from the insertion cursor to the position after the motion. Insert mode, entered by i (among others), inserts further keys at the insertion cursor and advances it. Replace mode, started by r, is similar but overwrites text instead of inserting it. Visual mode, started by v, accepts commands just as command mode, but commands operate on the selection (indicated by reverse colors), and motion commands change the selection. Visual line mode only allows whole lines to be selected. Ex commands can be entered by typing a colon, though this is not considered a separate mode. Pressing escape in any mode switches back to command Page 1 Plan 9 (printed 12/22/24) VIXEN(1) VIXEN(1) mode. User interface The main text window is a view of the current buffer. The title contains the name ``vixen'' and the absolute path of the file being edited. Vixen makes sure the insertion cur- sor is always visible, unless the view is scrolled by the scrollbar. Under the window is the status bar, it contains the current mode, the buffer's file name (or that none has been set yet), the number of lines and characters in the file, the current insertion position, the characters that have been collected as a command, and optionally an error message. When entering line-based commands, such as ex com- mands and searches, the status bar is temporarily replaced by a text entry widget. The end of the buffer is indicated by an EOT character in blue color on white background color. The insertion cursor is shown before the character it is positioned at. The visual selection is indicated in reverse colors. A text search match is indicated with black text on a yellow background, after a change of the text the colors are removed. After an incoming plumb message, the added text or addressed line is indicated by white text on a blue background. The colors are removed on the first key stroke or command. The edit entry, for ex commands and searches, has file name completion and a history. Pressing tab inter- prets the word before the cursor as a filename completes it to the largest common prefix of the matches. If the word is already the largest common prefix, each tab fills in the next match. History is accessed with the up and down arrow keys. Up selects the previous line that prefix-matches the text typed so far, down the next. Buffer The buffer is the data that commands operate on. All data is utf-8, arbitrary binary files cannot be edited. Vixen always has exactly one buffer The buffer can be in `modi- fied' state, i.e. not yet flushed to disk. A file name may be associated with a buffer, either because the buffer was read from that file or because the buffer has previously been written to it. Insertion cursor and positions The buffer always has a insertion cursor (or just `cursor'), where text in insert or replace mode will be inserted, and commands will operate from. The position of the insertion cursor is represented as a line (starting at 1) and column (starting at 0) within that line. Positions always repre- sent a character with one exception: it can be positioned after the last character in the buffer, at the end of file. Page 2 Plan 9 (printed 12/22/24) VIXEN(1) VIXEN(1) Different from most vi clones, the insertion cursor can be positioned at a newline. In an empty buffer, e.g. when starting vixen without parameters, the only valid position is ``1.0''. Selection The selection is indicated by reverse colors, and only pre- sent while in one of the visual modes. On entering the visual mode, the start and end of the selection is set to the cursor position. On entering the visual line mode, the selection is set from start of the cursor's line to the end of the cursor's line (including newline). Motion commands are interpreted from the end of the selection, even if its position is before the start of the selection (possible due to backwards motions). Registers and macro's Registers can hold textual data. They are useful to tem- porarily store text, for later use. Special registers exist too, automatically updated. Some commands, especially those that delete or insert text, modify a register. This regis- ter can be changed by prefixing the command with the <reg> command. The same applies to commands that use a register, e.g. yank. The contents of a register can also be executed with the @<reg> command, as a macro. Macro's can also be recorded by the q<reg> command, and ended by a subsequent q command. <reg>. Registers: Holds text removed during last deletion. . Holds last insertion with insert or replace mode. % Current filename, may be empty. Read-only. / Pattern of last text search. * Contents of snarf buffer. ! Command last executed by ex command :b command. a-z Registers available to user. A-Z Aliases for registers a-z. Writes to these registers append to the lower cased registers, instead of writing them. Page 3 Plan 9 (printed 12/22/24) VIXEN(1) VIXEN(1) Marks Marks are positions in the file. They can be set by the m<mark> command and jumped to by `<mark> and '<mark> com- mands (the first jumps to the exact position, the second to the first non-blank character of the position's line). Some marks are automatically set when navigating the buffer, some cannot be modified by the user, see the table below. A mark is automatically deleted when the text at its position is deleted. Marks always point to the same character, and are automatically adjusted on insertions and deletions before them. The following marks are available: < First character of visual selection (regardless of direction of selection, so not necessarily the start of the selection). Set automatically when changing the visual selection, read-only. m-command. > Last character of visual selection. ` and ' Many non-trivial motion commands are considered jumps. These identical marks contain the position of the insertion cursor before the last jump. . Location of last change, insertion or deletion. Read- only. ^ Location of last insertion of text. Read-only. a-z No special meaning. Note that marks A-Z and 0-9 are not available. Changes and undo/redo Each modification of the buffer, e.g. by a command or an insertion through insert mode, is recorded as a change. It can be undone by the u command. Undone commands can be redone by the ^r command. Inserting text Text can be inserted in the buffer while in an editing mode, insert or replace mode. The last typed character can be removed by ^h, the last typed word by ^w, the last typed line by ^u. Only text typed after switching to the current editing mode can be removed with the commands above. Com- mands have to be used for other deletions. When in replace mode, text is overwritten. Newlines are never overwritting though, so when the cursor is at the end of a line, replace mode is effectively the same as insert mode. Erasing over- written text reveals the original text again. Page 4 Plan 9 (printed 12/22/24) VIXEN(1) VIXEN(1) Plumbing Plumbing is supported through the non-visual gP,gpp and gp<motion> commands, and the (identical) visual commands gp and gP. Quick write and compile cycles are supported by the gb and ex' :b [command] commands. Vixen uses a helper pro- gram vixenplumb (not otherwise documented) to keep track of which files are being edited, and routes plumb requests accordingly or starts a new vixen. COMMANDS Motion commands Motion commands set the insertion cursor. While in visual select, they change the selection. As modifier in commands, they indicate the range of text for the command to operate on. Many motion commands can be prefixed by a repeat count (not starting with zero). For example j moves the cursor down one line, while 3j moves the cursor down three lines. The table below lists the motion commands and their cursor destination when a repeat has not been specified. Commands prefixed with <n> interpret a repeat count, but all commands accept them. 0 or Home Column 0 of line. <n>h or <n>Left Character to the left, stopping at column 0. <n>l or <n>Right Character to the right, stopping at the newline. <n>space Character to the right, not stopping at newlines. <n>w Start of next word, stopping at interpunction. <n>W Start of next word, not stopping at interpunction. <n>e End of next word, stopping at interpunction. <n>E End of next word, not stopping at interpunction. <n>b To start of previous word, stopping at interpunction. <n>G If <n> was not specified, moves to the end of the file. Otherwise, interprets <n> as line number and moves to first non-blank character on the line. $ or End Page 5 Plan 9 (printed 12/22/24) VIXEN(1) VIXEN(1) End of current line (at newline if any). ^ First non-blank character on line. <n>- First non-blank character on previous line. <n>+ or <n><newline> First non-blank character on next line. <n>_ First non-blank on current line or <n>-1 lines relative from cursor. <n>[fFtT]<char> Find next (for f and t) or previous (for F and T) char on current line. f and F place the cursor at the char- acter, t on the character before it, T on the character after it. <n>; Repeat last character find command ( [fFtT]) <n>, Repeat last character find command, but in reverse direction (effectively executing the command with swapped case). <n>/ or <n>? Search forward or backward. The regex(6) pattern to search for must entered in the edit entry at the bottom of the window. <n>* or <n># Search for the word under the cursor, # searches in reverse. This sets the last search string used by com- mands n and N. <n>n or <n>N Repeat last search, N reverse the search direction. <n>% If n was given it is interpreted as a percentage of the lines in the file, and the cursor is moved to that line, to the first non-blank character. Otherwise, jump to the counterpart of the nearest (forward) char- acter in (){}[], taking nesting into account. <n>| Column n on current line, or column 0 by default. <n>( or <n>) or <n>{ or Next/previous sentence ( ) and () or next/previous paragraph ( } and {). In other vi implementations, the { and } commands also stop at troff paragraph commands, vixen does not. `<mark> or '<mark> Page 6 Plan 9 (printed 12/22/24) VIXEN(1) VIXEN(1) To mark. Entire file is kept in memory twice: in vixen and in Tk. Page 7 Plan 9 (printed 12/22/24)