123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768 |
- .TH AIT "1" "April 2024" "ait 1.9" "General Commands Manual\fR
- .SH NAME
- .B ait
- \- small yet mighty GNU Emacs style editor
- .SH SYNOPSIS
- .B ait
- .B [-vh]
- [\fI\,file\/\fR [+/-\fI\,number\/\fR] ...]
- .br
- .B ait
- .B [-b backup_dir]
- .B [-s switch_command]
- [\fI\,file\/\fR [+/-\fI\,number\/\fR] ...]
- .SH DESCRIPTION
- .B ait
- is intended to be small, portable, and powerful Emacs-like text editor. While
- those are the top 3 main goals,
- .B ait
- also is intended to be simple in both implemetation and use, support the most
- important GNU Emacs keybindings, support UTF8 and unicode, to not reinvent
- the wheel, and to be stable. You will find many differences between GNU Emacs
- and
- .B ait
- as
- .B ait
- is
- .I not
- intended to be an Emacs clone. Some of the most prominent differences are:
- the lacks of a config, of lisp, of 100% custom window layouts, of major syntax
- highlighting, and of modes in general.
- .B ait
- instead is simple enough that you can change the source to change the
- keybindings, uses the existing system as the extension language (see
- \fBSHELL COMMANDS\fR), uses a simple static-window system that works for 99% of all editing
- purposes, and supports the bare-minimum syntax highlighting (see
- \fBSYNTAX HIGHLIGHTING\fR). Think of
- .B ait
- as a microEMACS implementation of GNU Emacs with concepts from Plan 9's acme
- editor.
- .TP
- The options are as follows:
- .TP
- \fB+/- number\fR
- Go to the line specified by number (do not insert a space between the '+' or '-'
- sign and the number). If a negative number is specified, the line number counts
- backwards from the end of the file i.e. -1 will be the last line of the file,
- -2 will be second last, and so on.
- .TP
- \fB-v\fR
- Print version and exit
- .TP
- \fB-h\fR
- Print help and exit
- .TP
- \fB-b backup_dir\fR
- Supply a directory to place the backups.
- .TP
- \fB-s switch_command\fR
- Supply a custom command, in your PATH, to switch buffers with. This command should
- accept the list of buffers in a newline seperated list and should return just the
- buffer name, exactly as it was, followed by a newline character. The newline
- charcter generally will be added automatically by most programs. This option is
- useful if you wish to have fuzzy-searching or something else special that isn't
- supported by the minimal interface provided by the msgline. Generally, speaking
- this command isn't used all the time as it requires another keybinding just to
- access it. See section
- .B COMMANDS
- sub-section
- .B C-x b
- for how to use it.
- .TP
- .SH POINT & MARK
- .B ait
- is written using a gap buffer and therefore some of the lingo used to describe
- various behaviors come from this. The
- .I point
- is the location of the cursor in the buffer. The
- .I mark
- is a point that is set by the user to define either the beginning or end of the
- \fIregion\fR.
- The region is used for a variety of functions such as cut, copy, and
- shell-command. The point and mark are both buffer specific. Each time the a mark
- is added, it is added to a mark history. The poptomark command will allow you
- to jump to previous marks using this history.
- There are some note-worthy special cases that may confuse users at first.
- Firstly, persistent column. If you haven't explicitly changed the current
- column using something fwd-word, back-char, etc.
- .B ait
- will remember which column you're on. This makes editing things that are
- in the same column but seperated by short lines a lot easier. Secondly,
- brack-matching is supported for all heterogeneous bracket types (), {}, <>,
- and []. It is not supported for homogeneous ones ("", '', ``). You can, however,
- still use forward-bracket and backward-bracket to jump to them. Matched brackets
- are highlighted in magenta. If you've just typed the closing or opening bracket,
- .B ait
- will highlight the match in green until you move the cursor or the editor is
- repainted. Thirdly, regarding the forward/backward-bracket functions, if there
- is a mark they will overshoot to allow you to select the entire enclosed text
- and its brackets. For example, if you have the code (+ 1 2) and the point is on
- ( and you place a mark there and run forward-bracket, the point will actually go
- one character to the right of the), effectively allow you to kill that entire
- block of code. If the point were on the ) and you place a mark there and run
- backward-bracket, the mark will be moved one character to the right of the ) and
- then the point moved to the (. The two previous cases only work when the point
- is on the bracket and not next to it like in GNU Emacs. If a line goes over the
- allotted column wide for a window, it will automatically line-wrap. To show
- this, the last character of the row will be highlighted yellow.
- .SH WINDOWS AND BUFFERS
- When a file is loaded into
- \fBait\fR, it is stored in a \fIbuffer\fR. This buffer may be displayed on the
- screen in more than one \fIwindow\fR. Each window is delineated by a
- .I modeline
- at the bottom. The modeline contains important information about the buffer
- inside the window. The second position in the modeline will contain an "O" if
- that buffer is in overwrite mode. If changes are made to a buffer, you will see
- an asterisk in the third position of that buffer's window's modeline. If a file
- is changed outside
- .B ait
- and its buffer is about to be changed,
- .B ait
- prompts if the change should go ahead (y), not go ahead (n) or if the buffer
- should be reverted (r) to the latest file on disk. The default buffer is called
- .I *scratch*
- and is not saved when you close the program. In the modeline you will also find
- the buffer name. This name is usually the same as the file's name unless there
- is another buffer loaded with the same file name. In that case, the buffer name
- will contain the directory name in the name i.e. dir/foo.txt. If another buffer
- contains the same previous directory, the sync will continue until a non-match
- is found. The file name usually contains the entire path to that file and is
- seen when you save the buffer. Next in the modeline is the row and
- column inside of parenthesis. Lastly, there is the percentage of the
- buffer you're viewing. If you're at the top and you can't page up
- anymore, you'll see TOP. If you can't page down anymore you'll see
- BOT. Otherwise, you'll see the percent.
- Unlike GNU Emacs,
- .B ait
- doesn't allow the user to make endless window configurations. There are only 8
- supported window modes: one, horizontal, vertical, triple horizontal, triple
- vertical, Fibonacci right, Fibonacci left, and quad. Horizontal and vertical
- mode are 2 window splits in the respective direction. The triple modes are
- the same as the previous just with 3 windows. Fibonacci modes are modes that
- have 2 small windows that make up the height of the third large window. It is
- called this because it resembles the first 3 squares in the Fibonacci sequence.
- Lastly, quad mode is a 4 window mode with 4 windows, one in each quadrant. Also
- unlike GNU Emacs, close-window doesn't exist. You can only change window modes
- and so the keybinding C-x 0 will take you back to one window mode. When you
- change modes
- .B ait
- will attempt to fill the windows by following the buffer trail (explained in the
- next parapgraph). This isn't always right but is extremely handy.
- The order of buffers and windows is not handled by any array or list. They are
- handled by pointers that point to other pointers, thus creating a "trail" of
- sorts. The buffer trail is the path to the order of the open buffers i.e.
- current-buffer(foo.txt->b_next(bar.txt)->b_next(README)->b_next(NULL). The
- list must always end with NULL.
- .SH MSGLINE
- Under all windows and modlines is the prompt area, namely, the \fImsgline\fR.
- This is where all non-editing input is handled. Unlike GNU Emacs, the msgline
- is not a buffer but a special place for messages and prompts. In most prompts,
- most of the basic movement keybindings are usable: backward-char, forward-char,
- back-word, fwd-word, delete, backspace, kill-line, beginning-of-line,
- end-of-line, back-word-delete, fwd-word-delete, and insert-control-char.
- .SH SPECIAL CHARACTERS
- There are some unique special things that you may seen while using
- .B ait
- that may spark a question. First, a tab character is denoted by a 4 space
- line yellow UTF-8 character. This makes it easy to see whether spaces or actual
- tabs are being used. This character doesn't show correctly when you're in the tty.
- Second, if control characters make it into the file they
- are denoted, as GNU Emacs does, by a ^ followed by the letter that corresponds
- to that control character in red foreground cololr. For example, the form feed
- control character (ASCII 0x0C) would show up as ^L because 0x4C is an L in
- ASCII. Third, trailing whitespace is denoted by a red background color but only
- shows when you are not at the end of the trailing space. Fourth, completely
- empty lines that contain no buffer data are denoted by a cyan tilde (~)
- similarly to how
- .B vi(1)
- does it. This makes it easy to see when you're at the bottom of the file
- visually. Alternatively one could use the modeline BOT string to obtain
- the same conclusion.
- .SH KEYBINDINGS
- Keybindings in
- .B ait
- are written similarly to other Emacs clones. "C" means control and "M" means
- meta. Therefore, "C-x" means control plus the x key and "M-x" means meta/alt plus
- the x key. Since
- .B ait
- is usable on pretty much any terminal, it was selected to use esc instead of "M" to
- describe meta. Therefore, "esc x" means the same as "M-x". The below list has
- the keybinding in bold, followed by the common name for the function that the
- keybinding runs, followed by a description on how that function works.
- .TP
- \fBC-a\fR
- beginning-of-line, move the point to the beginning of the line.
- .TP
- \fBC-b / left\fR
- backward-char, move the point to the left by 1 character.
- .TP
- \fBC-d / delete\fR
- delete, delete the character that the point is currently pointing to.
- .TP
- \fBC-e\fR
- end-of-line, move the point to the end of the line.
- .TP
- \fBC-f / right\fR
- foward-char, move the point to the right by 1 character.
- .TP
- \fBC-h / backspace\fR
- backspace, delete the character directly to the left of the point.
- .TP
- \fBC-i\fR
- indent, insert 2 spaces.
- .TP
- \fBC-k\fR
- kill-to-eol, cut from the point to the end of the line.
- .TP
- \fBC-l\fR
- recenter, jump the page from top, middle, and end of the window following this
- cycle: middle, top, end, repeat.
- .TP
- \fBC-x u / C-/\fR
- undo, unlimited linear undo. See
- .B UNDO & REDO
- for more information.
- .TP
- \fBC-n / down\fR
- next-line, move the point down by 1 line.
- .TP
- \fBC-m / enter\fR
- newline, insert a newline character at the point.
- .TP
- \fBC-p / up\fR
- previous-line, moved the point up by 1 line.
- .TP
- \fBC-q\fR
- insert-control-char, prompts you in insert a control character. If you insert an invalid one, it will put '^@' (string terminator)
- .TP
- \fBC-r\fR
- reverse-isearch, prompt the user for a search query and search start at the
- point going up. See the section
- .B ISEARCH
- for more information.
- .TP
- \fBC-o\fR
- newline-below, insert a newline character at the end of the current line.
- .TP
- \fBC-s\fR
- reverse-isearch, prompt the user for a search query and search start at the
- point going down. See the section
- .B ISEARCH
- for more information.
- .TP
- \fBC-t\fR
- transpose, flip the position of the character at the point with the character
- directly to the left of it.
- .TP
- \fBC-u\fR
- universal-argument, at the moment all this does is run certain commands
- 4^(number of C-u presses) times. In Emacs, universal-argument does much more
- and
- .B ait
- does have a framework to do more with it but isn't fully implemented due to lack
- of necessity.
- .TP
- \fBC-v / pagedown\fR
- forward-page, move the page by one full page down.
- .TP
- \fBC-w / esc k\fR
- kill-region, cut the region. See
- .B POINT AND MARK
- and
- .B KILL RING
- for more information.
- .TP
- \fBC-y\fR
- yank, insert the scrap at the point. If you apply the universal argument to this
- command it will yank from the kill ring. See
- .B POINT AND MARK
- and
- .B KILL RING
- for more information.
- .TP
- \fBC-z\fR
- suspend, suspend
- .B ait
- .
- .TP
- \fBC-space / esc @\fR
- set-mark, set the point as the current mark.
- .TP
- \fBC-g / C-x C-g\fR
- remove-mark, remove the current mark. C-g is also used to quit any command
- in
- .B ait
- .
- .TP
- \fBC-x 0 / C-x 1\fR
- delete-other-window, return to one window mode.
- .TP
- \fBC-x 2\fR
- split-window, split into horizontal window mode.
- .TP
- \fBC-x 3\fR
- chop-window, split into vertical window mode.
- .TP
- \fBC-x 4\fR
- tri-split, split into triple horizontal window mode.
- .TP
- \fBC-x 5\fR
- tri-chop, split into triple vertical window mode.
- .TP
- \fBC-x 6\fR
- fib-right, split into Fibonacci right mode.
- .TP
- \fBC-x 7\fR
- fib-left, split into Fibonacci left mode.
- .TP
- \fBC-x 8\fR
- quad-window, split into quad window mode.
- .TP
- \fBC-x o\fR
- other-window, jump cursor to the next window in the window trail. See
- .B WINDOWS AND BUFFERS
- for more information.
- .TP
- \fBC-x =\fR
- cursor-position, print information on current cusor location to the msgline.
- .TP
- \fBC-x i\fR
- insert-file, insert a file into the current buffer.
- .TP
- \fBC-x k\fR
- kill-buffer, kill the current buffer. If unsaved, prompt to save.
- .TP
- \fBC-x C-n / C-x n\fR
- next-buffer, switch to the next buffer in the buffer trail. See
- .B WINDOWS AND BUFFERS
- for more information.
- .TP
- \fBC-x l\fR
- last-buffer, switch to the last buffer you previous had as the current.
- .TP
- \fBC-x b\fR
- switch-to-buffer, prompt the user to select which buffer they'd like to switch to.
- If the universal-argument (C-u) is supplied while being prompted to switch buffer,
- it
- .B ait
- will attempt to run the buffer-switch command, if there is one supplied.
- .TP
- \fBC-x (\fR
- start-kbd-macro, begin a keyboard macro. See
- .B KEYBOARD MACROS
- for more information.
- .TP
- \fBC-x )\fR
- end-kbd-macro, end a keyboard macro. See
- .B KEYBOARD MACROS
- for more information.
- .TP
- \fBC-x e\fR
- run-kbd-macro, execute a keyboard macro. See
- .B KEYBOARD MACROS
- for more information.
- .TP
- \fBC-x C-f\fR
- find-file, prompt the user to select a file to open.
- .TP
- \fBC-x C-s\fR
- save-buffer, save the current buffer to disk.
- .TP
- \fBC-x C-w\fR
- write-file, save the current buffer to a new file.
- .TP
- \fBC-x C-c\fR
- exit, quit
- .B ait
- .
- .TP
- \fBC-x C-x\fR
- pop-to-mark, jump point to previous mark points.
- .TP
- \fBC-x C-;\fR
- comment, if there is a single line comment string for the current file
- extension, add it to the beginning of the line. If there is a region and
- there are multi-line comment strings for the current file extension, put
- the start comment delimiter at the top and the end at the bottom of the
- region. If the current line is a comment, remove it. If the point is
- within a multi-line comment, remove the multi-line comment. This functions
- differently than GNU Emacs.
- .TP
- \fBesc 0\fR
- numeric-arg-0, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 1\fR
- numeric-arg-1, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 2\fR
- numeric-arg-2, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 3\fR
- numeric-arg-3, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 4\fR
- numeric-arg-4, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 5\fR
- numeric-arg-5, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 6\fR
- numeric-arg-6, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 7\fR
- numeric-arg-7, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 8\fR
- numeric-arg-8, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc 9\fR
- numeric-arg-9, see
- .B NUMERIC ARGUMENT
- for more information.
- .TP
- \fBesc b\fR
- back-word, move point to the left by one word.
- .TP
- \fBesc bksp\fR
- back-word-delete, delete one word to the left. See
- .B WORD DELETE
- and
- .B KILL RING
- for more information.
- .TP
- \fBesc f\fR
- fwd-word, move point to the right by one word.
- .TP
- \fBesc d\fR
- fwd-word-delete, delete one word to the right. See
- .B WORD DELETE
- and
- .B KILL RING.
- for more information.
- .TP
- \fBesc x\fR
- execute-shell-cmd, execute a shell command. See
- .B SHELL COMMANDS
- for more information.
- .TP
- \fBesc g\fR
- goto-line, prompt the user to select which line to jump to.
- .TP
- \fBesc G\fR
- goto-column, prompt the user to select which column to jump to.
- .TP
- \fBesc r\fR
- jump-to-row, jump to a line on the current page by pressing the
- combination of chars displayed on that line.
- .TP
- \fBesc j\fR
- jump-word, jump to a word on the current page starting with the input
- char by pressing the combination of chars displayed at the start of
- that word.
- .TP
- \fBesc i\fR
- indent, insert a tab character at the point.
- .TP
- \fBesc m\fR
- back-to-indentation, jump point to the next non-whitespace character.
- .TP
- \fBesc n\fR
- negate, set the negate flag. This isn't used much and almost no commands use it.
- I've found it more valuable to have custom keybindings to run commands in
- reverse.
- .TP
- \fBesc o\fR
- open-shell-cmd, execute a shell command to open a new buffer. See
- .B SHELL COMMANDS
- for more information.
- .TP
- \fBesc %\fR
- query-replace, prompt the user to replace something in the buffer. See
- .B QUERY REPLACE
- for more information.
- .TP
- \fBesc v / pageup\fR
- backward-page, move the page by one full page up.
- .TP
- \fBesc w\fR
- copy-region, copy the region. See
- .B POINT AND MARK
- and
- .B KILL RING
- for more information.
- .TP
- \fBesc < / home\fR
- beg-of-buf, set point to the beginning of the buffer.
- .TP
- \fBesc > / end\fR
- end-of-buf, set point to the end of the buffer.
- .TP
- \fBesc \\\fR
- delete-between, delete all whitespace to the right and left of the point.
- If the point is in the middle of a word (any where but the first and last
- char of the word), it will delete the word. It acts as if you typed
- `esc f esc backsp`. If you use the universal argument, this command can be
- used like vim(1) `i` text object selection and will delete the contents
- inside the bracket. You can jump over matching brackets by adding more
- universal arguments. For example, if you wanted to jump in-between a string
- and delete its contents but you aren't inside it. You'd want to have at
- least 2 universal arguments. This is due to the quotes being homogeneous.
- .TP
- \fBesc /\fR
- redo, redo an undo. You an redo as many undos as there are. See
- .B UNDO & REDO
- for more information.
- .TP
- \fBesc t\fR
- transpose word, flip the word the point is currently in the the word to the left.
- .TP
- \fBesc l\fR
- lowercase-word, make the next word (starting at the point) lowercase.
- .TP
- \fBesc c\fR
- capitalize-word, capitalize the next word (starting at the point).
- .TP
- \fBesc u\fR
- uppercase-word, make the next word (starting at the point) uppercase.
- .TP
- \fBesc ;\fR
- jump-to-char, prompt the user to select a character to the right of the point
- to jump the point to.
- .TP
- \fBesc :\fR
- negated-jump-to-char, prompt the user to select a character to the left of the
- point to jump the point to.
- .TP
- \fBesc z\fR
- zap-to-char, delete all characters to the right until the point reaches the
- insert character. If the universal argument is applied, it will zap to the
- char but not the char.
- .TP
- \fBesc Z\fR
- negated-zap-to-char, delete all characters to the left until the point reaches the
- insert character. If the universal argument is applied, it will zap to the
- char but not the char.
- .TP
- \fBinsert\fR
- toggle-overwrite-mode, toggle between insert and overwrite mode.
- .TP
- \fBC-M-f\fR
- foward-bracket, jump the point to the match of the bracket at the
- point going to the right.
- .TP
- \fBC-M-b\fR
- backward-bracket, jump the point to the match of the bracket at the
- point going to the left.
- .TP
- .SH ISEARCH
- isearch stands for incremental search and is the normal way to search for
- something in a buffer. isearch has two modes: isearch and isearch-reverse.
- isearch goes down the buffer and reverse goes up. It is paramount that you
- understand how the prompt for isearch works to use it to it's best ability.
- While in the isearch function is running, you have a few keybindings at your
- disposal other than the normal msgline keybinds:
- .TP
- \fBesc / C-g\fR
- Quit. This will take you back to the original start point.
- .TP
- \fBC-s\fR
- Jump to next match. If in isearch-reverse, switch to isearch.
- .TP
- \fBC-r\fR
- Jump to next match. If in isearch, switch to isearch-reverse.
- .TP
- \fBenter\fR
- Accept match, quit isearch, and stay at that point.
- .TP
- .PP
- Once you've reached a point where there are no more matches, pressing the
- respective keybind (C-s in isearch, C-r in isearch-reverse) will continue the
- search from the beginning or end of the buffer respectively. Lastly, if you type
- an all lowercase query it will search for matches
- \fIregardless of case;\fP meaning that it searches with case insensitivity.
- If you put any uppercase letter into the query, the search now becomes case
- sensitive.
- .SH UNDO & REDO
- It's not overtly obvious when a undo set happens, the explanation is quick. An
- undo set happens whenever you break a chain of similar commands - if you are
- typing a big paragraph but don't manually move the cursor, delete
- anything, or run any other commands you'll find the undo will remove that entire
- paragraph. This is because you haven't broken the chain of commands. A redo
- only becomes available once you've undone something.
- .SH NUMERICAL ARGUMENT
- Numerical argument is a way to run a keybinding many times. It is most useful
- when used in combination with keyboard macros but can also be nice when doing
- normal editting as well. When you begin entering a numeric argument you'll see
- "C-u x", where x is the number you've added, in the msgline. Upon entering the
- next number you will find that it doesn't add to the original number but rather
- shifts the original number into the next most significant digit. This makes it
- very easy to do massive recurring edits.
- .SH QUERY REPLACE
- The query-replace function is useful to replace multiple occurances of something
- with another something. This function is very straightforward on how to use so
- an explanation isn't needed. Once in the search, 'y' will accept the replace,
- replace the query with the replacement, and move to the next match; 'n' will
- skip the current match, '!' will accept all occurances without asking, and 'q'
- will quit. You may also use C-g to quit before you get to searching part or
- C-g and enter in the searching part. If there are more instances of the query,
- you may use 'l' (stands for last) to replace the current result and then quit.
- This is useful when you want to just replace a handful but don't want to be
- jumped to the next result.
- .SH WORD DELETE
- Similarly to GNU Emacs, if you consecutively execute the fwd-/back-word-delete
- commannds, it will add each new cut word to the scrap. Also, the undo/redo
- commands will undo these consecutive commands in 1 use similarly to how it works
- with consecutive character input or deletion.
- .SH KEYBOARD MACROS
- Also similar to GNU Emacs (and many other editors),
- .B ait
- can collect keyboard data into a keyboard macro. This feature does not record
- everything but most commands can be used with it. You must first start recording
- by executing start-kbd-macro. You will see a K in the modeline of the current
- buffer where the O for overwrite mode would be. Then perform the actions you
- wish to run later. All editing and movement commands can be recorded. File,
- buffer, suspend, and the like commands cannot be recorded, for obvious reasons.
- Once recording is finished, run the end-kbd-macro command. You can then execute
- it with execute-kbd-macro.
- .SH KILL RING
- Every time you cut (sometimes referred to as kill) some text, it gets placed
- into the scrap buffer. This buffer is placed into the kill ring once it is
- overwritten. The kill ring is a list of previously cut, or killed, data from the
- scrap buffer. You can recall this data by using the universal argument on the
- yank command. Each universal argument represents the next item in the kill ring.
- Most of the time you'll need something that you recently yanked and will only
- have to use 1, 2 or, at most 3 universal arguments. This feature is very handy
- and allows you to kill text without having to worry about yanking it somewhere
- else while you do some other editing.
- .SH SHELL COMMANDS
- One of the most powerful features in
- .B ait
- is the support to open files using custom commands and running shell commands.
- When running a shell command (esc x) there are 2 types: input and replace. Input
- happens when you have no region and you want to input the output of a command.
- One of the best uses of this is with xclip(1) or pbpaste(1) (on macOS) allowing
- you to paste in the editor. Replace happens when there is a region. In a region
- command the region is passed into the shell command and the output of that command,
- unless empty (just contains a null terminator or newline), is then placed where
- the region was. One of the best uses of this is a spell checker.
- .B ait
- ships with an example script called "spell" that uses this technique, however,
- it requires pick(1) and aspell(1) to be installed.
- open-command (esc o) is very straightforward, use anything you want to find the file
- you want to open and make a script that returns just the file and path. You can have
- .B ait
- open the file at a certain line number if the filename is appended with a colon,
- followed by the line number. This makes it easier to work with standard commands such
- as grep(1)'s -n option. The caveat to this is that you cannot use open-command to open
- files that have a colon in the file name. While this is non-standard, it's worth
- mentioning.
- .B ait
- ships with a few examples of this "ff" (find file) and "gg" (git grep) which
- both require pick(1) and git(1) to be installed.
- There may, in the future, be a way to have commands that don't effect the buffer
- or commands that effect the entire buffer added in later version.
- .SH SYNTAX HIGHLIGHTING
- .B ait
- lacks good syntax highlighting because it's not really needed. However, it is
- helpful to have something to help differentiate when something is in a string
- or a comment - which is the only syntax highlighting that
- .B ait
- supports. This feature is file extension dependent and must be added directly
- into the source (buffer.c). The structure allows you to specify the file
- aextension, a single line comment, multi-line comment start (NULL if there
- isn't any), multi-line comment end (NULL if there isn't any), if a single
- quote is a string, and if a backquote is a string.
- .SH TAB COMPLETION
- While prompting for a file, buffer, or shell command one can use the tab key or
- C-i to preform some basic tab completion. In the file prompt, one you're in a
- directory tabbing will cause the next alphabetic file or directory to popular.
- You can continue to press tab to go down the line. Note that you can type more
- and it will change the completion to fit that newly typed text. Once you get to
- the end, it will loop back. If you've come across a directory, you will need to
- press return or another character to use the tab completion inside of that
- directory. When prompted for a buffer, it works exactly the same except there are
- no directories. When prompted for a shell command via the shell-command or
- open-command commands, it will search your PATH environment variable for matches
- and loop around again if nothing is found. It's very important to note that tab
- completion only ever works when you're at the end of the msgline buffer.
- .SH BACKUP FILES
- Backups are created right before the buffer is written to disk. They contain the
- file's contents before it is overwritten.
- Backup files usually end in ~ and are, by default, placed in the working
- directory. You can optionally set a backup directory with the -b option.
- Backups that are sent to the the backup directory contain the entire path with
- the slashes replaced with exclamation points i.e. /home/foobar/foo.txt ->
- !home!foobar!foo.txt. The best way to use this is by setting an alias for in
- your .profile for each user.
- .SH AUTHOR
- .B ait
- is a fork of an editor called atto. Atto was a fork of an editor called AE.
- From Atto's README: "Atto is based on the public domain code of Anthony Howe's
- editor (commonly known as Anthony's Editor or AE, [2])..."
- That being said, parts of
- .B ait
- are written by all three of us: Anthony Howe,
- Hugh Barney, and Kevin Bloom.
- Kevin Bloom is the current maintainer.
- .SH KNOWN ISSUES
- You may view and track issues here: https://notabug.org/nuclearkev/ait/issues.
- Combined emojis will also cause the modeline to claim you're column
- number is 1 more than it really is. This is caused by the extra emoji
- and invisible combinator character. This bug is so minimal I don't
- find the need to fix it at this point.
- If you set a mark and begin to delete or add text, the mark will move
- either backwards or fowards because the point for that mark is
- changing. You can see this behavior similarly when you have a region.
- While from a technical aspect this isn't actually a bug to the user
- this would appear to be one since the mark isn't "staying put."
- .SH "REPORTING BUGS"
- Report bugs to https://notabug.org/nuclearkev/ait/issues
- .SH COPYRIGHT
- Public Domain 1991, 1993 by Anthony Howe. No warranty.
- Public Domain 2014-2022 by Hugh Barney. No warranty
- Copyright \(co 2023-2024 Kevin "The Nuclear" Bloom.
- .B ait
- comes with ABSOLUTELY NO WARRANTY.
- You may redistribute copies of
- .B ait
- under the terms of the BSD 3-Clause License.
- For more information about these matters, see the file named LICENSE.
- .SH "SEE ALSO"
- .BR mg (1),
- .BR emacs (1).
|