VED(1L)
π VED(1L) β visual editor (screen-oriented) π
okay bestie, this is ved(1L) from SchilyΒ΄s USER COMMANDS β the manual page for the visual editor. Buckle up, we're doing terminal lore π
πΈ NAME πΈ
ved β visual editor (screen-oriented). That's the whole name section, short and iconic π
π¦ SYNOPSIS π¦
ved [ options ] [ filename ... ]
ved-e [ options ] [ filename ... ]
ved-w [ options ] [ filename ... ]
π DESCRIPTION π
Ved (visual editor) is a small and very fast screen-oriented editor, and its user interface sits somewhere between vi and emacs. It's powerful and easy to learn, it has no limitations on line length and the type of characters that may appear in a file. It has almost no limitations on file size and supports editing of large files (files > 2 GB) if the OS has large file support. β¨
To use ved to edit a file for the first time, call ved and specify the name of the file you want to edit. If you edit a file for the second time, ved will place you at the same cursor position that was used the last time when editing this file. If you do not specify a file name, ved will assume that you want to edit the last file you edited in your current directory. The cursor position in this case again will be the same as with the last editing session for this file. π«Ά
Calling ved-e is the same as calling:
ved -e
Calling ved-w is the same as calling:
ved maxlinelen=78.
Ved is using the termcap data base to be independent from the terminal type. See Termcap section below. π
β¨ OPTIONS β¨
-v,-vhelp,-vedhelpβ an editing session is started with the on-line help. This is done in read-only mode. π-r,-readonlyβ in this mode, you may edit the content of the edit buffer but you are not allowed to write back the modified buffer by using the quit command of the editor. If you use this option more than once, the readonly value is incremented. If-readonlyis used twice or more, you are not allowed to write the file back even in quit force mode. π₯b=#,buffers=#β by defaultveduses10in-core buffers to edit the file, each in-core buffer takes8 kB(the actual values that are compiled intovedmay be retrieved by callingved -help). Files that are bigger than the total amount of in-core buffer space are edited by using the swap file ofved. If you specify a number that is higher than the default, you will need more space in memory but the speed will slightly increase.-n,-nobakβ don't createfilename.bakwhen writing back the file using the quit command of the editor. Note that if you use this option you will still break hard links. If you like to write into the original file, you should better use the'W'command when you quitved.-nolockβ don't try to use record locking to tell other editors that a file i.e. being edited or just being written to. This option may help if NFS record locking bugs would otherwise cause an edit session to hang in thefcntl()lock request.-e,-edtmpβ don't write to the file.vedtmp.uid. (vednormally stores the names and cursor positions of files in.vedtmp.uid)-raw8β do not expand characters with the MSB set. Note thatvedwill by default not expand characters with the MSB set that seem to be printable, e.g. when the terminal is in 8-bit mode. If this option is used, the expansion of 8-bit characters is turned off unconditionally. If the terminal is in 7-bit mode, this may result in incorrectly displayed characters.-d,-dosβ map new-line to carriage-return new-line and hide carriage-return characters that are directly followed by a new-line. If you type in a new line character this results in inserting a carriage-return new-line pair. But asvedis acting binary transparently, reading in files that do not follow DOS newline conventions will not cause the content of the file to be automatically converted to use DOS new-lines.
If -nodos has not been specified, ved tries to auto-detect whether a file needs DOS (CR/LF to LF) mapping or not.
-nodosβ do not map new-line to carriage-return new-line and hide carriage-return characters that are directly followed by a new-line. If-nodoshas been specified, auto-detection of DOS files is disabled and files will always be edited in POSIX line mode.s=search stringβ start editing session with search tosearchstr.-t,-tagβ first filename is really actag.wrapmargin=#β set default wrap margin to#. The wrap margin is counted from the end of a terminal line.maxlinelen=#β set max line length for autowrap to#. The behaviour is similar to thewrapmargin=option butveddoes not use the maximum linelength from the current screen width but the fixed length#.-R,-Recoverβ recover session from specified filename.vedgenerates a filevedP.xxxxin the/var/tmpdirectory or in the directory named by theVED_TMPDIRenvironment in which all action of the user is stored during the session. This file must be used as the only argument tovedwhen running a recover session.
π THE STATUS LINE π
The first (top) line of the screen is reserved for ved status information. The status line is divided into five fields. The fields are (from left to right):
Info/Inputβ the first field is used to display informational messages and to fetch additional input that is required for some commands. Each command that needs confirmation requests input from this field. The size of this field defaults to1/4thof the length of a line. This field may use more space if needed.Numberβ the second field contains the current multiplier for the next command. The current multiplier is reset to1after each command, it may be set to a different value by the user (See NUMBERS section below). This multiplier will be referred to asnumberin the following text. The size of this field is fixed to1/8thof the length of a line. If the actual number does not fit into the given space, the textBIGis printed instead.Takebufferβ the third field contains the name of the actual take buffer that is used for cut and paste operations. The name of this buffer defaults todefaulton startup. It may be changed by the user. The size of this field is fixed to1/4thof the length of a line.Filenameβ the fourth field usually displays the current filename. The size of this field defaults to1/4thof the length of a line. It may use up more space if needed and no error text is displayed. It may be hidden for some time if a long error message is displayed.Error textβ the fifth field is used to display all error messages and warnings. The size of this field defaults to1/4thof the length of a line. If needed, it may use the space of the filename field too.
π BASIC COMMAND FORMAT π
Ved does not distinguish between command mode and insert mode. Unless prefixed by commands that need arguments, all non control characters are treated as input (which is inserted into the file buffer). π
All basic ved commands are control characters or escape sequences. To enter a control character, use the control key like the shift key together with a character key; to enter an escape sequence, press the <ESC> key followed by another key.
In the following description, ^ represents the control key and <ESC> the escape key (which is identical to pressing ^[). <ALT> has a similar usage as <ESC> but different meaning in ved and represents the combination ^]. The combination ^char is a single keystroke, while <ESC>char or <ALT>char are two keystrokes. If the command takes an argument, the argument is terminated with a carriage return <CR>.
A command may be modified in five ways:
- Escape commands β typing the
<ESC>key (or^[) before the command will modify it to an alternate form, usually a related function. - Alt commands β typing the ALT key (
^]) before the command, inserts a mark (with a few exceptions) in the text usually at the current cursor position and then executes the normal command. You can precede any command that moves the cursor with the ALT key andvedsets the mark before moving the cursor. - Alt Escape commands β typing ALT (
^]) and ESC (^[) before the command, inserts a mark (with a few exceptions) in the text usually at the current cursor position and then executes the ESC command. You can precede any ESC command that moves the cursor with the ALT key andvedsets the mark before moving the cursor.
Typing ESC followed by ALT yields in the same effect.
- Extended commands β typing a
^Xbefore another command enters the extended mode. The extended mode just enters another level of commands. These extended commands have their own list of basic, ESC, ALT and ALT/ESC command tables. - Multiplied execution β numbers that are entered by typing
<ESC>#<CR>(#represents a positive number) will set the multiplier to that number and display it in the status line ofved. If a number greater than one is entered before a command, that command is usually repeatednumbertimes. Exceptions are some cursor movement commands where different functions will be executednumbertimes instead of repeating the visible basic functionality of the command.
π§ CURSOR MOVEMENT π§
Like every editor, ved has a typing point, called cursor, which is indicated by the (in most cases) flashing bar or box (depending on your terminal/window type) on your screen. The cursor indicates the point within the file buffer where the typed characters are going to. It is your current place in the file buffer. The commands that move the cursor within the file buffer are explained in this section. πΈ
Cursor movement command overview:
Key CTRL ESC CTRL ALT ALT ESC
Label set mark first set mark first
β¦and the table just keeps going, so here's the rest of it β same four-column deal as before:
|β A start of line start of para start of line start of para
F2 B go to beginning go to bottom go to beginning go to bottom
β| E end of line end of para end of line end of para
β F forward char forward word forward char forward word
β H back char back word back char back word
β N down line down para down line down para
β P up line up para up line up para
tiny vocab moment before we go any further: para is used as an abbreviation for paragraph, purely so the table fits into the standard line width. slay, honestly. π
π Cursor movement commands in detail π
okay this is the part where we actually explain every single one of those keys, because the table is cute but it's not gonna hold your hand. buckle up bestie, there are a lot of them, and honestly? every one is a banger.
the ^A family β beginnings, but make it fashion π
^Aβ moves the cursor to the beginning of the current line. if the cursor is already at the beginning, it will not move.
if number is greater than one, ^A moves the cursor that number of characters from the beginning of the current line.
<ESC>^Aβ moves the cursor to the beginning of the current paragraph. if the cursor is already at the beginning, it will not move.
if number is greater than one, <ESC>^A moves the cursor that number of words from the beginning of the current paragraph.
<ALT>^Aβ inserts the mark at the current cursor position before moving the cursor to the beginning of the current line. if the cursor is already at the beginning, it will not move, butvedwill still inserts the mark. (yes, mark goes down either way. she's committed.)
if number is greater than one, <ALT>^A inserts the mark, then moves the cursor that number of characters from the beginning of the current line.
<ALT><ESC>^Aβ inserts the mark at the current cursor position before moving the cursor to the beginning of the current paragraph. if the cursor is already at the beginning, it will not move, butvedwill still inserts the mark.
if number is greater than one, <ALT><ESC>^A inserts the mark, then moves the cursor that number of words from the beginning of the current paragraph.
the ^B family β file-wide jumps, main character energy ππ₯
^Bβ moves the cursor to the beginning of the file. if the cursor is already at the beginning of the file, it will not move.
if number is greater than one, ^B moves the cursor that number of lines from the beginning of the file.
<ESC>^Bβ moves the cursor to the end of the file. if the cursor is already at the end of the file, it will not move.
if number is greater than one, <ESC>^B moves the cursor that number of lines from the end of the file.
<ALT>^Bβ inserts the mark at the current cursor position before moving the cursor to the beginning of the file. if the cursor is already at the beginning of the file, it will not move, butvedstill inserts the mark.
if number is greater than one, <ALT>^B inserts the mark, then moves the cursor that number of lines from the beginning of the file.
<ALT><ESC>^Bβ inserts the mark at the current cursor position before moving the cursor to the end of the file. if the cursor is already at the end of the file, it will not move, butvedstill inserts the mark.
if number is greater than one, <ALT><ESC>^B inserts the mark, then moves the cursor that number of lines from the end of the file.
the ^E family β the endings, and yes she has lore πΈπ¦
^Eβ moves the cursor to the end of the current line. if the cursor is already at the end of the line, it will not move. the last character on the line is the invisible ASCII newline characterNL; when the cursor is at the end of the line, it is not on a visible character. (so don't panic if it looks like the cursor is floating in the void β it's on theNL, she's just invisible. π)
if number is greater than one, ^E moves the cursor that number of characters from the end of the current line.
<ESC>^Eβ moves the cursor to the end of the current paragraph. if the cursor is already at the end, it will not move.
if number is greater than one, <ESC>^E moves the cursor that number of words from the end of the current paragraph.
<ALT>^Eβ inserts the mark at the current cursor position before moving the cursor to the end of the current line. if the cursor is already at the end of the line, it will not move, butvedstill inserts the mark.
if number is greater than one, <ALT>^E inserts the mark, then moves the cursor that number of characters from the end of the current line.
<ALT><ESC>^Eβ inserts the mark at the current cursor position before moving the cursor to the end of the current paragraph. if the cursor is already at the end of the paragraph, it will not move, butvedstill inserts the mark.
if number is greater than one, <ALT><ESC>^E inserts the mark, then moves the cursor that number of words from the end of the current paragraph.
the ^F family β forward, forward, forward β¨
^Fβ moves the cursor one character position to the right.
if number is greater than one, ^F moves the cursor that number of characters to the right.
depending on the cursor position, with or without number being greater than one, ^F could move the cursor to a later line. if the cursor is at the end of the line, the cursor will move to the first position of the next line.
<ESC>^Fβ moves the cursor forward to the first letter of the next word.
if number is greater than one, <ESC>^F moves the cursor forward that number of words.
depending on the current cursor position and the value of number, <ESC>^F might move the cursor down one or more lines.
<ALT>^Fβ inserts the mark at the current cursor position before moving the cursor one character to the right.
if number is greater than one, <ALT>^F inserts the mark, then moves the cursor that number of characters to the right.
<ALT><ESC>^Fβ inserts the mark at the current cursor position before moving the cursor to the first letter of the next word.
if number is greater than one, <ALT><ESC>^F inserts the mark, then moves the cursor that number of words to the right.
the ^H family β back it up, bestie π
^Hβ moves the cursor one character position to the left.
if number is greater than one, ^H moves the cursor that number of characters to the left.
depending on the cursor position, ^H, with or without number being greater than one, could move the cursor up to the previous line. if the cursor is at the beginning of the line when you press ^H, the cursor will move to the last position of the previous line.
<ESC>^Hβ moves the cursor to the first letter of the word just prior to its current position.
if number is greater than one, <ESC>^H moves the cursor that number of words backwards. depending on the current cursor position and the value of number, the cursor may move up one or more lines.
<ALT>^Hβ inserts the mark at the current cursor position before moving the cursor one character position to the left.
if number is greater than one, <ALT>^H inserts the mark, then moves the cursor that number of characters to the left.
<ALT><ESC>^Hβ inserts the mark at the current cursor position before moving the cursor to the first letter of the previous word.
if number is greater than one, <ALT><ESC>^H inserts the mark, then moves the cursor that number of words to the left.
the ^N family β down we go π
^Nβ moves the cursor down one line while maintaining its horizontal position. if the cursor is on the last character of the last line when you press^N, the cursor will not move and you will hear a beep. (that beep is her way of saying "no β€οΈ")
if number is greater than one, ^N moves the cursor down that number of lines. if number is greater than the number lines remaining in the file, the cursor will stop moving at the end of the file.
<ESC>^Nβ moves the cursor to the beginning of the next paragraph.
if number is greater than one, <ESC>^N moves the cursor down that number of paragraphs.
<ALT>^Nβ inserts the mark at the current cursor position before moving the cursor down one line. note that the cursor maintains its horizontal position on the line; i.e., if the cursor was on the fifth character of the line when you pressed<ALT>^N, it will move to the fifth character of the line below.
if number is greater than one, <ALT>^N inserts the mark, then moves the cursor down that number of lines.
<ALT><ESC>^Nβ inserts the mark at the current cursor position before moving the cursor to the beginning of the next paragraph.
if number is greater than one, <ALT><ESC>^N first inserts the mark, then moves the cursor down that number of paragraphs.
the ^P family β up, up, and away π
^Pβ moves the cursor up one line while maintaining its horizontal position. if the cursor is on the first line of the file when you press^P, the cursor will not move and you will hear a beep.
if number is greater than one, ^P moves the cursor up that number of lines. if number is greater than the number of lines between the cursor and the beginning of the file, the cursor will stop moving at the beginning of the file.
<ESC>^Pβ moves the cursor to the beginning of the previous paragraph.
if number is greater than one, <ESC>^P moves the cursor that number of paragraphs prior to the cursor's position.
<ALT>^Pβ inserts the mark at the current cursor position before moving the cursor up one line. note that the cursor maintains its horizontal position on the line; i.e., if the cursor was on the fifth character of the line when you pressed<ALT>^P, it will move to the fifth character of the line above.
if number is greater than one, <ALT>^P inserts the mark, then moves the cursor up that number of lines.
<ALT><ESC>^Pβ inserts the mark at the current cursor position before moving the cursor to the beginning of the previous paragraph.
if number is greater than one, <ALT><ESC>^P first inserts the mark, then moves the cursor up that number of paragraphs prior to its current position.
okay so that's the whole movement situation β every direction, every family, every number multiplier, all accounted for. and notice how the <ALT> versions all slide the mark in first no matter what, even when the cursor literally cannot move? that's not a bug bestie, that's the design. π«Ά
π INSERTION/DELETION π
okay so first thing bestie β every single insertion happens exactly where the visible cursor is sitting. no sneaky surprises, no "oops where did that go". where you see the cursor is where the text lands. periodt. π
Deletions are a whole vibe of their own β they get saved in two buffers:
- the forward delete buffer β holds everything you yeeted with forward delete commands
- the backwards delete buffer β holds everything you yeeted with backward delete commands
and the backwards one? it saves those characters in reverse order, specifically so you can reinsert them in the correct order later. iconic behavior honestly π
So as long as you don't move the cursor and start deleting new text in either direction, you can reinsert the contents of both the forward and the backwards delete buffer with the undo delete command. which is lowkey the whole trick: you can move text around by deleting it and reinserting it after you've moved the cursor to another position in the file β¨
β¨ Insertion/Deletion command overview β¨
Key CTRL ESC CTRL ALT ALT ESC
Label set mark first set mark first
F3 D delete char delete words ~ ~
TAB I tab ~ tab ~
NL J insert new line ~ jump to mark switch mark
and cursor
F4 K kill line kill para kill selection ~
CR M insert new line change modes sets mark ~
F5 O open line ~ open line ~
_ undo delete ~ clear mark ~
DEL DEL erase char erase word ~ ~
(iykyk, the ~ means "nope, nothing here bestie" π¦)
πΈ Insertion/Deletion commands in detail πΈ
^Dβ erases the character at the cursor position.
If number is greater than one, ^D erases that number of characters to the right of the cursor.
<ESC>^Dβ erases the next word. A word is defined from the current cursor position to the next blank or carriage return.
If number is greater than one, <ESC>^D erases that number of words to the right of the cursor.
^Iβ inserts aTABcharacter.
If number is greater than one, ^I inserts that number of TAB characters.
<ALT>^Iβ inserts the mark at the current cursor position before inserting aTABcharacter.
If number is greater than one, <ALT>^I inserts the mark, then inserts that number of TAB characters.
^Jβ inserts a new line at the current cursor position and moves the cursor to the beginning of the next line.
If number is greater than one, ^J inserts that number of new lines.
^Kβ erases the current line. If the cursor is located at the beginning of the line, the entire line is erased, including the carriage return at the end of the line. If the cursor is located between the beginning and end of the line, everything right of the cursor is erased, including the carriage return at the end of the line. You can use^Kto erase blank lines.
If number is greater than one, ^K erases that number of lines from the current cursor position.
<ESC>^Kβ erases from the current cursor position to the end of the paragraph. The end of a paragraph is indicated by two successive carriage returns β one at the end of the last line and one on the blank line that follows the paragraph.
If number is greater than one, <ESC>^K erases that number of paragraphs.
<ALT>^Kβ erases text between the mark and the current cursor position. for instance, if the mark is in the middle of the file and the cursor is at the end, the last half of the file will be erased π^Mβ inserts a new line at the current cursor position and moves the cursor to the beginning of the next line.
If number is greater than one, ^M inserts that number of new lines.
^Oβ inserts a new line at the current cursor position, but does not move the cursor. Any text to the right of the cursor moves down to start a new line.
If number is greater than one, ^O inserts that number of new lines without moving the cursor.
<ALT>^Oβ inserts a new line without moving the cursor. It inserts the mark at the beginning of the next (new) line.
If number is greater than one, <ALT>^O inserts that number of new lines without moving the cursor. It inserts the mark after the last new line.
^DELETEβ erases the character to the left of the cursor. This acts the same as using theDELETEkey alone.
If number is greater than one, ^DELETE erases that number of characters to the left of the cursor.
<ESC>^DELETEβ erases the word to the left of the cursor. This acts the same as using^DELETE.
If number is greater than one, <ESC>^DELETE erases that number of words to the left of the cursor.
^_β reinserts the last deletion. The content of the forward and backward delete buffer is cleared after reinserting the deleted text.<ALT>^_β erases the mark.
π¦ CUT/PASTE π¦
these ones are all about the take buffers and bestie they are so good. you can have up to 32 take buffers, each named as you choose when you use it for the first time π
The name appears on the status (top) line of the terminal screen following \:. The default take buffer is "default".
β¨ Cut/Paste command overview β¨
Key CTRL ESC CTRL ALT ALT ESC
Label set mark first set mark first
F6 T save line save para save selection ~
into paste buf into paste buf into paste buf into paste buf
F7 V paste paste and replace select replace select
clear paste buf with paste buf clear paste buf
Y save char save word ~ ~
into paste buf into paste buf
F8 \\ chng paste buf clr paste buf ~ ~
π Cut/Paste commands in detail π
^Tβ removes a line from the file buffer and puts it in the current take buffer. The line is defined from the current cursor position to the next carriage return.
If number is greater than one, ^T removes that number of lines from the file buffer and puts them in the current take buffer.
<ESC>^Tβ removes a paragraph from the file buffer and puts it in the current take buffer. A paragraph is defined from the current cursor position to two successive carriage returns β one at the end of the last line and one on the blank line that follows the paragraph.
If number is greater than one, <ESC>^T removes that number of paragraphs from the file buffer and puts them in the current take buffer.
<ALT>^Tβ removes the selection (what lies between the mark and the cursor) and puts it in the current take buffer.^Vβ pastes the contents of the current take buffer into the file at the current cursor position. The take buffer will still contain a copy of the text. π<ESC>^Vβ pastes and clears the contents of the current take buffer into the file at the current cursor position. The take buffer will be empty.<ALT>^Vβ replaces the selection (what lies between the mark and the cursor) with whatever is in the current take buffer. The old content of the selection is not saved in any way. The take buffer will still contain a copy of the text.<ALT><ESC>^Vβ replaces the selection (what lies between the mark and the cursor) with whatever is in the current take buffer and clears the take buffer. The old content of the selection is not saved in any way. The take buffer will be empty.
bestie pls clock this: both of those <ALT> replace-selection moves literally do not back up what they overwrite. no undo buffer, no nothing. gone. π
^Yβ removes a character from the file buffer and puts it in the current take buffer. The character at the current cursor position is the one taken.
If number is greater than one, ^Y takes that number of characters and puts them in the current buffer.
<ESC>^Yβ removes a word from the file buffer and puts it in the current take buffer. A word consists of any characters from the current cursor position up to the next blank or carriage return.
If number is greater than one, <ESC>^Y takes that number of words and puts them in the current buffer.
^\β changes the current take buffer.
On the information line you will see the Take Buffer: prompt. Type a take buffer name and press the RETURN key.
If you type a new name, a new take buffer is created. If you type a name you have already used during the current editing session, you can reuse that take buffer. The take buffer name is always displayed on the information line.
<ESC>^\β clears any text out of the current take buffer. On the information line you will see theBuffer clearedmessage.
32 buffers. thirty-two. the way that's basically a whole little clipboard collection and you can name them whatever you want π«Άπ
π SEARCH π
Okay bestie, these commands go looking for the text you specify in the file buffer, and they may move the cursor to a match. π
If the pattern contains pattern matching meta characters, the pattern matcher is used β unless the no magic mode has been selected, see the set command below. If there are no meta characters, a simple search is used.
See match(1) for more information on the pattern matcher.
β¨ Search command overview β¨
F9βCTRL:R= forward search.ESC CTRL:<ESC>^R= reverse search.ALT:<ALT>^R= forward search.ALT ESC:<ALT><ESC>^R= reverse search. TheALTandALT ESCcolumns carry the label set mark first.F10βCTRL:Z= re-search.ESC CTRL:<ESC>^Z= reverse re-srch.ALT:<ALT>^Z= re-srch.ALT ESC:<ALT><ESC>^Z= reverse re-srch. Again,ALTandALT ESCare set mark first.
π Search commands in detail π
^Rβ searches forward in a file for the specified text string.
On the information line you will see the +Search: prompt. Type the string you want to find. If the string exists between the cursorβs current position and the end of the file, ved moves the cursor to that location. If ved can not find the specified string, the cursor does not move and you will hear a beep.
If number is greater than one, ^R finds that numbered occurrence of the string.
<ESC>^Rβ searches backwards in a file for the specified text string.
On the information line you will see the -Search: prompt. Type the string you want to find. If the string exists between the cursorβs current position and the beginning of the file, ved moves the cursor to that location. If ved can not find the string, the cursor does not move and you will hear a beep.
If number is greater than one, <ESC>^R finds that numbered occurrence of the string.
<ALT>^Rβ searches forward in a file for the specified text string.
On the information line you will see the +Search: prompt. Type the string you want to find. When (and if) found, the mark is inserted at the beginning of the string and the cursor moves to the end of the string; the string is then considered selected. If ved can not find the string, the cursor does not move, no mark is inserted, and you will hear a beep.
If number is greater than one, <ALT>^R finds that numbered occurrence of the string.
<ALT><ESC>^Rβ searches backwards in a file for the specified text string.
On the information line you will see the -Search: prompt. Type the string you want to find. When found, the mark is inserted at the beginning of the search string and the cursor moves to the end of the string; the string is then considered selected. If ved can not find the string, the cursor does not move, no mark is inserted, and you will hear a beep.
If number is greater than one, <ALT><ESC>^R finds that numbered occurrence of the string.
^Zβ re-searches for the last text string you asked for with the^R,<ESC>^R,<ALT>^R, or<ALT><ESC>^Rcommand. If you already found one occurrence of the text string,^Zwill find the next occurrence. Ifvedcan not find another occurrence, the cursor does not move and you will hear a beep.
If number is greater than one, instance, ^Z finds that numbered occurrence of the string.
<ESC>^Zβ reverses direction and re-searches for the last text string you asked for with the^R,<ESC>^R,<ALT>^R, or<ALT><ESC>^Rcommand. If you already found one occurrence of the text string,<ESC>^Zwill find the next, or previous, occurrence, depending on your direction. For instance, if the original command was^R,<ESC>^Zwill find the previous occurrence. Ifvedcan not find another occurrence, the cursor does not move and you will hear a beep.
If number is greater than one, instance, <ESC>^Z finds that numbered occurrence of the string.
<ALT>^Zβ re-searches for the last text string you asked for with the^R,<ESC>^R,<ALT>^R, or<ALT><ESC>^Rcommand. If you already found one occurrence of the text string,<ALT>^Zwill find the next occurrence, set the mark at the beginning of it, and move the cursor to the end of it. This occurrence of the string is then considered selected. Ifvedcan not find another occurrence, the cursor does not move, no mark is inserted, and you will hear a beep.
If number is greater than one, instance, <ALT>^Z finds that numbered occurrence of the search string, with the numbering beginning from the current cursor position. For instance, if number is 4, the next three occurrences are skipped and the mark is inserted at the beginning of the fourth occurrence of the string. This happens regardless of how many occurrences of the string have already been located, unless there are not that many occurrences of the string in the file.
<ALT><ESC>^Zβ reverses direction and re-searches for the last text string you asked for with the^R,<ESC>^R,<ALT>^R, or<ALT><ESC>^Rcommand. If you already found one occurrence of the text string,<ALT><ESC>^Zwill find the next, or previous, occurrence, depending on your direction. For instance, if the original command was^R,<ALT><ESC>^Zwill find the previous occurrence, set the mark at the beginning of it, and move the cursor to the end of it. This occurrence of the search string is then considered selected.
If number is greater than one, instance, <ALT><ESC>^Z finds that numbered occurrence of the search string, with the numbering beginning from the current cursor position.
πΎ EXITING/SAVING πΎ
These commands are all about quitting ved and saving the current version of the edited text in a file. Lowkey important, bestie. π«Ά
^Cβ the QUIT command ends the editing session.
On the information line you will see the QUITTING. PUT EDITS? (Y/W/N/F/!) prompt.
- Type
Yif you want to save the changes made during this editing session by creating a backup file and creating a new file that holds the modified content. The backup process is done the following way:
The current backup file (if there is one) (called filename.bak) is deleted, the current file is renamed to filename.bak, and a version of the file containing the latest changes becomes filename. If there is no filename.bak, filename becomes filename.bak.
- Type
Wif you want to save the changes made during this editing session by directly writing the new content into the old file. - Type
Fif you want to forcibly save the changes made during this editing session. This command works similar to theYcommand, butvedwill ignore the state of the-readonlyflag and the access rights of the file. The latter will allow you to write into files without write permissions if you are super user. For exceptions on this rule, see description of the-readonlyflag. - Type
!if you want to forcibly save the changes made during this editing session by directly writing the new content into the old file. - Type
Nif you want to end the session but donβt want to save the changes.
If you donβt want to end the session, type anything except Y, W, F, ! or N.
If the file has been locked before by another edit session or if the file has been modified more recently than the copy that has been used for the current session, you will not be allowed to save the file. Use the force commands (F or !) or write back using different file name.
<ESC>^Cβ the BACKUP command backs up the current file.
On the information line you will see the BACKUP?(Y/W/N/F/!) prompt.
If you enter one of the expected answers (Y, W, ! or N) the same actions as with the QUIT command are performed except that the controls stays inside ved after the backup command has completed.
^X^Hβ calls on-line help.
On the information line you will see the HELP(Y?) prompt. To continue editing (and abort this command), type N. To see the help file, type Y.
Note that this command may not work in case that the terminal in use outputs a backspace when typing the DEL key. In such a case, it is appropriate to type: ESC : vhelp
^X^Zβ suspends the current editing session.
On the information line you will see the SUSPENDING. PUT EDITS? (Y/W/N/F/!) prompt.
- Type
Yif you want the file to be backuped and updated before suspendingved. See the QUIT command for a description of the backup process. - Type
Wif you want the file to be updated in place before suspendingved. - Type
Fif you want file to be forcibly updated before suspendingved. This command works similar to theYcommand, butvedwill ignore the state of the-readonlyflag and the access rights of the file. The latter will allow you to write into files without write permissions if you are super user. For exceptions on this rule, see description of the-readonlyflag. - Type
!if you want file to be forcibly updated in place before suspendingved. - Type
Nif you want to suspendvedbut donβt want to save the changes before.
If you donβt want to suspend ved, type anything except Y, W, F, ! or N.
If the file has been locked before by another edit session or if the file has been modified more recently than the copy that has been used for the current session, you will not be allowed to save the file. Use the force commands (F or !) or write back using different file name.
When you are ready to continue editing, use the fg or resume command of your shell. You will return to the editing session. The cursor will be in the same place it was when you suspended the session, regardless of whether or not you saved your edits. β¨
πΎ FILE COMMANDS πΎ
^Gβ lets you insert another file at the current cursor position.
On the information line you'll see the Get from: prompt. Type a file name and press RETURN.
You can insert files from the current working directory or from other directories (as long as you use a valid path name). The path name is subject to filename globbing by your shell (e.g. wild cards work as long as they expand to exactly one filename). slay, globbing bestie β¨
<ESC>^Gβ exits the current file and enters another file.
On the information line you'll see the Change to: prompt. Type the name of the file you want to edit and press RETURN.
If the old file was modified, you'll see the CHANGING TO: filename. PUT EDITS?(Y/W/N/F/!) prompt; if you want to save and backup the edits in the current file.
- Type
Yif you want the file to be backuped and updated before changing the file. See the QUIT command for a description of the backup process. - Type
Wif you want the file to be updated in place before changing the file. - Type
Fif you want file to be forcibly updated before changing the file. This command works similar to theYcommand, but ved will ignore the state of the-readonlyflag and the access rights of the file. The latter will allow you to write into files without write permissions if you are super user. For exceptions on this rule, see description of the-readonlyflag. - Type
!if you want file to be forcibly updated in place before changing the file. - Type
Nif you want to change the file but don't want to save the changes before.
If you don't want to change the edited file, type anything except Y, W, F, ! or N.
If the file has been locked before by another edit session or if the file has been modified more recently than the copy that has been used for the current session, you will not be allowed to save the file. Use the force commands (F or !) or write back using different file name. no cap, that lock is not it π
^Wβ writes a copy of the file you're editing to the file you specify.
On the information line you'll see the Write to: prompt. Type a file name and press RETURN. If the file exists, its contents are overwritten. If the file does not exist, it is created.
<ESC>^Wβ writes the contents of the current take buffer to the file you specify.
On the information line you'll see the \ to file: prompt. Type a file name and press RETURN. If the file exists, its contents are overwritten. If the file does not exist, it is created. The take buffer contents will remain intact.
<ALT>^Wβ writes a copy of the selection (what lies between the mark and the cursor) to the file you specify.
On the information line you'll see the Sel to: prompt. Type a file name and press RETURN. If the file exists, its contents are overwritten. If the file does not exist, it is created.
π’ NUMBERS π’
<ESC>#<CR>β To enter a multiplier that only works for the next command, type<ESC>, enter a number and then press the RETURN key. If you entered a number by mistake, simply enter<ESC>1<CR>to reset the number to its default value.^Uβ multiplies number by the multiplier. The default multiplier is4. Each time you press^Unumber changes to the next multiple of4(16,16,64, and so on).<ESC>^Uβ changes the multiplier.
The default multiplier is 4. If you want to multiply number by a different value, use <ESC>^U. On the information line you'll see the Mult = prompt. Type a number and press the RETURN key.
β¨ MISCELLANEOUS β¨
<ALT>^Gβ lets you edit your editing macro file called.vedmac(which is located in your$HOMEdirectory). It is the same as if you used^X^Xto execute a new ved and answeredNto the put question. When you're through editing.vedmac, press^Cto continue editing the file you were in when you issued the<ALT>^Gcommand; you will be asked whether or not you want to put the edits from.vedmacbefore you return to the original file.<ALT>^Jβ moves the cursor to the mark.
The current cursor position determines whether this is a forward or backward movement. For instance, if the mark is in the middle of the file and the cursor is at the beginning, it's a forward movement; if the cursor is at the end, it's a backward movement.
<ALT><ESC>^Jβ switches the cursor and the mark.^Lβ redisplays the current screenful of text. This is useful after a message has been sent to your terminal which may have overwritten some of the text.<ESC>^Lβ adjusts the text displayed on the terminal screen so that the line the cursor is on becomes the optimum line on the screen. This usually is the center line of the display but it may be changed using the<ESC>:set optline # <CR>command. This may involve displaying different text, depending on where the cursor is when you use this command.<ALT>^Lβ Adjusts the current Line of the Cursor to be the first Line on Screen.<ESC>^Mβ changes modes.
On the information line you'll see the Mode?(ORV8) prompt. Type:
Dto enable or disable DOS mode.Vfor visible mode.Ofor overstrike mode.8to enable or disable raw8 mode.Rto reset back to default mode.<CR>to list the current mode settings.
If you type anything else, you will abort the command.
<ALT>^Mβ sets a mark at the current cursor position.<ESC>nβ displays the next Page of file.<ESC>pβ displays the previous Page of file.<ALT><ESC>nβ Sets a Mark, then displays the next Page of file.<ALT><ESC>pβ Sets a Mark, then displays the previous Page of file.^Qβ unfreezes the screen which was frozen by pressing^S.^Sβ freezes cursor and text movement on the screen. Use^Qto unfreeze it.^X^Xβ lets you execute a shell command without terminating the editing session.
Control temporarily returns to the Command Interpreter while the command is executed, then you can continue editing. For instance, if you want to read another file into the one you're editing but can not remember the file name, you can execute an ls command to find its name. When you type ^X^X, you'll see the Execute: prompt on the information line. Type the command line and press the RETURN key. If the file was modified before you called ^X^X, you'll see the EXECUTING. PUT EDITS? (Y/W/N/F/!) prompt.
- Type
Yif you want the file to be backuped and updated before executing the command. See the QUIT command for a description of the backup process. - Type
Wif you want the file to be updated in place before executing the command. - Type
Fif you want file to be forcibly updated before executing the command. This command works similar to theYcommand, but ved will ignore the state of the-readonlyflag and the access rights of the file. The latter will allow you to write into files without write permissions if you are super user. For exceptions on this rule, see description of the-readonlyflag. - Type
!if you want file to be forcibly updated in place before executing the command. - Type
Nif you want to execute the command but don't want to save the changes before.
If the file has been locked before by another edit session or if the file has been modified more recently than the copy that has been used for the current session, you will not be allowed to save the file. Use the force commands (F or !) or write back using different file name.
In all cases, after returning from the command, the cursor will be on the same place as it was before typing ^X^X.
Note: if the shell command you want to execute requires the current file as an argument, you might need to update it. For instance, if the file you are editing contains formatting commands that you want to test, you will need to update the file so that the version of the file you format and view is the most up-to-date one. iykyk, formatting tea β
To abort the command while you can see the Execute: prompt, do not type a command; simply press the RETURN key. If you had started to type a command, use the DELETE key to erase it; the field following the prompt must be blank. To abort the command while you can see the EXECUTING. PUT EDITS? (Y/W/N/F/!) prompt, type anything except Y, W, F, ! N.
<ESC>^Xβ executes the contents of the current take buffer.
You can type a shell command line in your file and then save it in a take buffer (using the ^T, <ESC>^T, ^Y or <ESC>^Y commands).
When you type <ESC>^X, you'll see the EXECUTING. PUT EDITS? (Y/W/N/F/!) prompt on the information line.
- Type
Yif you want the file to be backuped and updated before executing the command. See the QUIT command for a description of the backup process. - Type
Wif you want the file to be updated in place before executing the command. - Type
Fif you want file to be forcibly updated before executing the command. This command works similar to theYcommand, but ved will ignore the state of the-readonlyflag and the access rights of the file. The latter will allow you to write into files without write permissions if you are super user. For exceptions on this rule, see description of the-readonlyflag. - Type
!if you want file to be forcibly updated in place before executing the command. - Type
Nif you want to execute the command but don't want to save the changes before.
Heads up bestie π«Ά if the file's been locked by another edit session, or if it's been changed more recently than the copy your session is working from, you will not be allowed to save it. Your options? The force commands (For!), or write back out under a different file name. iykyk
<ALT>^Xβ executes the selection, aka everything between the mark and the cursor. π
Fr fr, you can literally type a shell command line into your file, select it, and run it. That's the whole vibe.
When you hit <ALT>^X you'll get the EXECUTING. PUT EDITS? (Y/W/N/F/!) prompt chilling on the information line.
- Type
Yif you want the file to be backuped and updated before executing the command. (Peep the QUIT command for the whole rundown on how backing up works.) - Type
Wif you want the file to be updated in place before executing the command. - Type
Fif you want the file to be forcibly updated before executing the command. This one works similar to theYcommand, except ved straight-up ignores the state of the-readonlyflag and the access rights of the file. That last bit means you can write into files without write permissions if you're super user π. For the exceptions to this rule, go read the description of the-readonlyflag. - Type
!if you want the file to be forcibly updated in place before executing the command. - Type
Nif you want to execute the command but do not want to save the changes first.
If you don't want to execute the command at all, type anything except Y, W, F, ! or N. Anything. Go wild. π
okay but seriously β if the file has been locked before by another edit session, or if the file has been modified more recently than the copy that's been used for the current session, you will not be allowed to save the file. Use the force commands (For!), or write back using a different file name. No cap. π
^@β indicates the current line number π. This number tells you how many lines exist between the beginning of the file and the current cursor position.
On the information line you'll see +Line: 333 where 333 is the current line number.
<ESC>^@β indicates how many lines exist between the current cursor position and the end of the file.
On the information line you'll see -Line: 22 where 22 is the number of lines remaining in the file.
<ALT>^@β indicates what line the mark is on, in relation to the beginning of the file β¨.
On the information line you'll see +Line: 45 where 45 is the positive line number on which the mark is located.
If there is no mark, you'll see No mark! displayed on the far right of the information line. π
<ALT><ESC>^@β indicates what line the mark is on, in relation to the end of the file.
On the information line you'll see -Line: 109 where 109 is the negative line number on which the mark is located.
If there is no mark, you'll see No mark! displayed on the far right of the information line.
^[β is the same as using the<ESC>key. Same energy, different keystroke. π«^]β is<ALT>. Use this sequence of keystrokes to start an ALT command.^Xβ is the lead in character for an extended command.<ESC>^]β is the same as using<ALT><ESC>.^^β quotes the next character so that it's taken literally, and then it gets converted to a control character π¦. For instance, if you want to include a command in a macro definition, you must quote the keystroke sequence. Otherwise the command will be executed rather than become part of your macro. (Not me learning that the hard way π)<ESC>^^β quotes the next character so that it becomes a 8 bit character.<ALT>^^β quotes the next character so that it becomes a 8 bit control character.<ALT><ESC>^^β quotes the next character so that you type it in in a hexadecimal notation.<ALT><ALT>β goto tag that is a word located at cursor position π―. See the FILES section for more info on the tag file.<ESC><ALT><ALT>β pop the tag stack by one entry. Every single time you go to a tag, the old location gets pushed on top of the tag stack. It's giving stack energy, because it literally is a stack. π<ESC>%β search for matching parenthesis. If this command is entered, the cursor gets put to the parenthesis that matches the parenthesis where the cursor is currently located. Matching-game slay π₯<ESC>*β Execute temporary macro. One temporary macro may be set up using the command<ESC>:macrocommand.<ESC>:β introduce a colon command πΈ. See the section COLON COMMANDS for more information.
π COLON COMMANDS π
Colon commands are introduced via <ESC>: β the command then may be entered on the (top) status line of ved. Main character energy: top line, all eyes on her. β¨
The colon commands are:
backupβ Backup current file. This command is the same as when<ESC>^Cis entered. It may be needed if for some reason it it not possible to enter the interrupt character of the terminal driver. π€bindβ Print the current command binding for ved. Later versions of ved may allow modification of the binding with this command. (Future us problems π«Ά)helpβ print online help for available colon commands.macromacro body β set up a temporary macro that may be executed via<ESC>*. π§mapmapfrom-string to-string β The first form lists all currently active mappings, the second form sets up a new mapping. Two modes, one command, iconic.nextβ switch to next file in file list. This command may only be used if ved has been called with more than one file argument.prevβ switch to previous file in file list. This command may only be used if ved has been called with more than one file argument.quitβ Quit ved. This command is the same as when^Cis entered. It may be needed if for some reason it it not possible to enter the interrupt character of the terminal driver.setsetset-variable set-args β The first form lists the current settings of ved, the second form sets a specific property of ved. The variables that may be modified via thesetcommand are:
autoindent
If set, ved activates the auto indent mode π. Subsequent lines will be automatically indented with the same indent as the previous line. Switch off with <ESC>:set noautoindent.
linelen new-linelen
Set linelength that is used as base for screen updates. This linelength usually is retrieved from the terminal driver but may be modified manually. π
magic
Switch to magic mode for pattern matching (this is the default when ved has been started) β¨. If in magic mode, matching is done using regular expression pattern matching. This mode may be switched off with <ESC>:set nomagic. If magic mode is turned off, matching is done without using regular expression matching even if the pattern contains magic characters for pattern matching. No cap, those magic chars just become normal little guys.
markwrap
Mark wrapped lines with a \ character at the end of a visible terminal line (this is the default when ved has been started) π. This mode may be switched off with <ESC>:set nomarkwrap.
optline opt-line
Set the optimal line. This is the line (counted from the top of the terminal) where the cursor is adjusted to when ved does scrolling. It is set by default to the half of the number of lines of the terminal. Halfway down, that's the vibe. π
pmargin page-margin
Set the distance you need to have between the cursor and the upper or lower border of the terminal. If you cross this border, ved will start to scroll and adjust the cursor to the optimal line. It is set by default to 0 and allows one to place the cursor to any visible line on the screen. π¦
psize page-size
Set pagesize that is used as base for screen updates. This pagesize usually is retrieved from the terminal driver but may be modified manually.
tabstop tab-width
Set the size of a visible tab character. This width is set to 8 by default. π
taglength tag-len-value
Set the number of characters that are used to compare a tag name with a tag label in the tags file. If it's set to 0 (the default), ved compares the complete tag length.
tags tag-file-list
Set the list if files that is searched when looking for a tag data base π―. The tag file list is separated by blanks and by default set to
tags .. /usr/lib/tags
This means that ved will first look for a file tags in the current directory, then search up for (directory by directory until the root directors is reached) a file tags and last it will look for a file /usr/lib/tags. Three stops, one search, periodt.
wrapmargin wrap-margin
If wrapmagin is set, ved will activate the auto-warp mode. In auto-wrap mode, ved will automatically insert a newline before a word if the cursor is less than wrap-magin from the right terminal border. π
substitute /old/new/β Substitute pattern old by new. The pattern new may contain an&for the old string. Swap slay πtagtag-name β goto tag named tag-name. See the FILES section for more information on the tag file.vhelpβ Edit the online help file. This is the same as callingved -vhelp. π
πΈ MACROS πΈ
Okay bestie, macros in ved are literally a combo of different ved basic commands plus input text. To create one, you need to edit the file .vedmac in your home directory. You can do that by either explicitly typing ved ~/.vedmac or by using the built-in ved command <ALT>^G.
The file ~/.vedmac contains a number of lines, and each line holds a macro definition like this:
L:/*^[74^M-*/: Comment Line
Each macro definition has three fields:
- name β the name of the macro. In our case, the name is simply
L, and the macro may be executed by typing Esc followed by L (<ESC>L). - function β the implementation of the macro. In our case, the function contains
/*^[74^M-*/and will draw a C-comment line that contains 74-chars as body. - comment β a comment for better understanding of the macro file. The comment is ignored.
The fields are separated by a colon.
Macros may be combined to form new macros. They also may recursively call each other, and you may set number to a value greater than one to execute a macro more than once. There is currently no way to execute a macro in a conditional way.
π¦ MAPPINGS π¦
You may create mappings in ved that contain arbitrary character sequences. To create a mapping, you need to edit the file .vedmap in your home directory.
The file ~/.vedmap contains a number of lines with the following structure:
map_from:map_to:comment
and holds a map definition like this:
\E[193z:^C:Quit Editor (L2)
Each map definition has three fields:
- map-from β the from string (left-hand side) of the map. In our case, the name is the sequence
\E[193z, which is the output of the L2 function key on a Sun keyboard. Every time when you type the character sequence\E[193zor hit a function key that emits this character sequence, it will be replaced by the replacement string before the input is read by ved. - map-to β the replacement (right-hand side, or βtoβ string) of the macro. In our case the map expands to
^Cand will quit ved. - comment β a comment for better understanding of the map file. The comment is ignored.
If both map_from and map_to are empty, the related line is ignored by the mapper, so a line may contain:
::comment
A nul character in either map_from or map_to is currently not supported, but an empty map_to is interpreted as a nul character.
If a line has an empty map_to and the comment field starts with a * like this:
map_from::*comment
an existing mapping is removed. This permits ignoring unwanted mappings that have been set up from the TERMCAP entry. A typical use case for this feature is to avoid the mapping:
^H:^?:Key Backspace -> Delete Char
that is caused by the TERMCAP capability kb for terminals that create a backspace with the delete key.
Since the file $HOME/.vedmap is read in a sequential way, a later line with the same map_from may establish a different mapping.
The fields are separated by a colon. The text in the macro file is fed through tdecode() to allow the same escape sequences as you may have in the termcap file.
π Input Mappings π
Ved maps input from the terminal into mapped text before it is interpreted by the editor. If a match is found on the input from the terminal, the related input text is directly replaced by its replacement string. A mapping may be prevented by typing the map quote character, which is the nul character (^@), directly before the matching text is entered. If this text is usually interpreted by ved, you first need to type the ved quoting character ^^. To be sure that you are able to literally enter some text, type ^^^@ (control up-arrow followed by Nul and the text).
At startup, ved first tries to initialize the terminal setup using the variables HOME, TERM, TERMCAP and TERMPATH.
If TERM is not set, the mapper establishes standard mappings for the cursor keys, assuming an ANSI-compatible terminal.
If TERM is set, the mapper establishes mappings for the following termcap capabilities:
kuβ Key cursor up, mapped to^P. The cursor is placed on the previous line.kdβ Key cursor down, mapped to^N. The cursor is placed on the next line.krβ Key cursor forward (right), mapped to^F. Move cursor one character to the right.klβ Key cursor left, mapped to^H. Move cursor one character to the left.khβ Key cursor -> Home, mapped to^A. The cursor is moved to the beginning of the current line.@7β Key cursor -> End, mapped to^E. The cursor is moved to the end of the current line.kDβ Key Delete Character, mapped to\177(DEL). Erase one character to the left of the cursor.kbβ Key Backspace, mapped to\177(DEL). Erase one character to the left of the cursor.
Note that the Backspace Key is the larger key that is just above the Carriage Return Key. In former times, this key was called Delete and send the \177 (DEL) character. Since companies followed the design of the IBM PC keyboard layout, the related key usually sends \010. If you like to literally enter a backspace, type ^^^@^H (control up-arrow followed by Nul followed by ^H).
k1β Key F1, mapped to Quit Editor (^C).k2β Key F2, mapped to Top of File (^B).k3β Key F3, mapped to Delete char (^D).k4β Key F4, mapped to Delete line (^K).k5β Key F5, mapped to Open line (^O).k6β Key F6, mapped to Cut line (^T).k7β Key F7, mapped to Paste (^V).k8β Key F8, mapped to Change buffer (^).k9β Key F9, mapped to Search down (^R).k;β Key F10, mapped to Re search (^Z).F1β Key F11, mapped to Get from (^G).F2β Key F12, mapped to Write to (^W).kAβ Key Insert, mapped to Insert line (^A^O).kEβ Key Clear EOL, mapped to Delete to eol (^K).kLβ Key delete line, mapped to Delete line (^A^K).kNβ Key Page down, mapped to Page down (^[n).kPβ Key Page up, mapped to Page up (^[p).kSβ Key Clear EOS, mapped to Delete to end of screen (^[999999\015^K).
After the mappings from the termcap entry for the current terminal type have been established, ved tries to read the file $HOME/.vedmap to retrieve additional mappings.
π Termcap π
The termcap data base is used to make ved independent from the terminal capabilities. Cursor key output is retrieved from the data base and mapped to the cursor movement commands of ved.
Ved uses a real termcap database, not terminfo. It is advised to have a suitable termcap database available, either in the file /etc/termcap or in the private file $HOME/.termcap with an entry for the terminal type that is currently in use. If an entry for the current terminal could not be found, ved uses a builtin terminal description for a minimal ansi compatible terminal.
The following variables are used by termcap:
HOMEβ To find the private files like$HOME/.termcap.TERMβ A name representing the type of the current terminal.TERMCAPβ This environment variable holds either a precompiled termcap entry or the pathname to be used to find a termcap database file. If it holds a precompiled entry that does not match theTERMenvironment, the termcap database is parsed as if theTERMCAPenvironment is not set. See section Parameter Substitution above for more information.TERMPATHβ IfTERMCAPis empty or not set, then theTERMPATHenvironment is scanned for pathnames of files that contain a termcap database. It holds a list of filenames separated by colons or spaces (i.e.,":"or" "). See section Parameter Substitution above for more information.
The following escape sequences are understood by the termcap implementation used by ved:
\\β The literal character\.\Eβ The ESC character (ASCII 033).\eβ The ESC character (ASCII 033).\^β The literal character^.\:β The literal character:.\,β The literal character,.\bβ The BACKSPACE character (ASCII 010).\fβ The FORMFEED character (ASCII 014).\lβ The LINEFEED character (ASCII 012).\nβ The NEWLINE character (ASCII 012).\rβ The CR character (ASCII 015).\sβ The SPACE character (ASCII 040).\tβ The TAB character (ASCII 007).\vβ The VERTICAL TAB character (ASCII 013).^cβ Maps tocontrol(c)for any appropriatec.^?β The DEL character (ASCII 0177).\nnnβ Maps to a character with the octal representationnnnwith 1..3 octal digits.\0β Maps to ASCII 0200.^@β Maps to ASCII 00.
Mapping \0 to ASCII 0200 is required by the termcap documentation. A real nul character created from (^@) is currently neither supported by the upper layers of termcap, nor by the upper layers of the mapper.
πΈ ENVIRONMENT πΈ
okay bestie, these are the env vars ved peeks at β set them right and you're glowing, ignore them and you get the default vibe π
SHELLβ the shell it uses for shell command escapes, file name globbing and similar stuff. basically who ved calls when it needs to run a command. πHOMEβ how ved finds your private little files~/.vedmac,~/.vedmapand~/.termcap. your home is literally the home of your config. πTERMβ the type of terminal ved should format its output for. get this wrong and everything looks a mess, no cap. πTERMCAPβ holds either a precompiled termcap entry or the pathname used to find a termcap database file. heads up tho: if it holds a precompiled entry that does not match theTERMenvironment, the termcap database gets parsed as ifTERMCAPisn't set at all. messy but that's the rule. π«TERMPATHβ ifTERMCAPis empty, thenTERMPATHgets scanned for pathnames of files containing a termcap database. it holds a list of filenames separated by colons or spaces (i.e.,":"or" "). and ifTERMPATHisn't set, the files$HOME/.termcapand/etc/termcapare scanned, in that order. ποΈBEEPβ set this tooffto suppress beeping. honestly iconic for using ved on a notebook in a meeting, so you don't announce your typos to the whole room π€«β¨PATHβ used to find ved's on-line help file. yes, the help file is found via your path. we love a scavenger hunt. πSLASHβ if it's set to'off', no slashes are accepted in filenames. enforce those boundaries bestie. π«VED_FTMPDIRβ the fast tmp directory. this is where the ved swap filevedF.processidlives. ifVED_FTMPDIRisn't specified, the swap file will usually be stored in/tmp/. β‘VED_TMPDIRβ the general tmp directory. this is where all ved tmp files except the swap file go. ifVED_FTMPDIRisn't defined butVED_TMPDIRis defined, all ved tmp files will be placed into this directory. and ifVED_TMPDIRisn't specified, the other ved tmp files will usually be stored in/var/tmp/. ποΈVED_STATISTICSβ if it's set and ved has been compiled with statistics support, ved will print statistic information at the end of a session. numbers! data! a little treat ππ
π FILES π
the receipts, bestie β every file ved touches and why π
/etc/termcapβ the system's terminal capabilities database.~/.termcapβ the private terminal capabilities database.~/.vedmacβ contains private macro definitions.~/.vedmapβ contains private mappings.~/.vedtmp.uidβ contains the names of the files that have been edit from the current directory as well as the cursor position of the last visit. ved also keeps track of the last edited file. yes it remembers where you were, it's giving attentive bestie energy π₯Ήtagsβ this file contains a list of tags that tell ved where a definition for a tag may be found. tags may contain e.g. function names, macro names and typedefs. by default, ved looks for atagsfile in the current directory, and if atagsfile isn't found in the current directory, the directories above the current directory are searched until the root directory is reached. if atagsfile can be found in a directory closer to the root directory, ved will modify the file path from within the tags file to reflect the directory distance to this tags file. this property is unique to ved β¨ and ved accepts tags files in the same notation asvi. iykyk π/tmp/vedF.processidβ the ved swap file./var/tmp/vedB.processidβ the ved backward delete buffer./var/tmp/vedD.processidβ the ved forward delete buffer./var/tmp/vedT.processidβ the current take buffer./var/tmp/vedTpastename.processidβ one file for every named take buffer. one per name, she's organized π/var/tmp/vedP.processidβ the ved crash recovery protocol buffer. the "oops" insurance π/var/tmp/vedX.processidβ the ved shell command execute buffer..../man/help/ved.helpβ the on-line help file is assumed to be in the same directory tree as the ved binary. π§
π SEE ALSO π
go read change(1) and match(1). that's the whole list, no filler, we respect your time π«Ά
π NOTES π
okay some real talk, bestie:
unlike vi, ved is not based on a line editor. this avoids annoying bugs but may cause to irritate people who are used to work with vi. so if a vi loyalist starts acting up in the group chat, that's why π
since ved uses a private implementation of the termcap terminal independent screen package, ved uses /etc/termcap even on systems that usually emulate termcap with terminfo. this allows us to use the portable terminal description on all operating systems. from my current point of view, ved will never switch towards terminfo. periodt. π
although terminfo provides more functionality than termcap, it tends to be non-portable between different platforms. while termcap allows one to have a private terminal database in the NFS mounted home directory, the same attempt tends to give problems with terminfo if a vendor did make private additions. because termcap explicitly names all capabilities, there are less problems with private additions; terminfo only uses an array index to identify a specific capability so this method only works if there is a global unique implementation. the way termcap just names things out loud instead of making you memorize indices β iconic behavior, honestly π
if your platform does not provide an /etc/termcap file, or if your termcap database does not contain an entry for the terminal type you're using, the following command may be used to convert a terminfo entry into a termcap entry and to append it to your private termcap database:
incofmp -C >> $HOME/.termcap
β οΈ make sure that the TERM environment is assigned to the correct terminal type. seriously, check it, don't just assume β¨
if the eighth bit of a character is "on", the tilde character ~ appears before characters, i.e., ~C. so if you see a lil wave hello, that's what's happening π«§
π BUGS π
none currently known. flawless, unbothered, moisturized β¨
mail bugs and suggestions to schilytools@mlists.in-berlin.de or open a ticket at https://codeberg.org/schilytools/schilytools/issues π¬
the mailing list archive may be found at:
https://mlists.in-berlin.de/mailman/listinfo/schilytools-mlists-in-berlin.de
π AUTHORS π
Joerg Schilling and the schilytools project authors. thank you for your service π«‘π
β¬οΈ SOURCE DOWNLOAD β¬οΈ
the source code for ved is included in the schilytools project and may be retrieved from the schilytools project at Codeberg at:
https://codeberg.org/schilytools/schilytools/
the download directory is:
https://codeberg.org/schilytools/schilytools/releases
and that's the whole manual page bestie, you made it to the end ππ¦ this gorgeous thing is by Joerg Schilling, dated 2022/09/14, and it's page VED(1L) β go forth and edit like the main character you are β¨π
π
π¦ where this page comes from
- opensuse-leap 16.0: ved 1.8-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: ved 1.8-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: ved 1.8-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: ved 1.8-160000.2.2 Β· CDDL-1.0
- Copyright 1984-2020 J. Schilling
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms