ait.1 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. .TH AIT "1" "May 2025" "ait 1.13" "General Commands Manual\fR
  2. .SH NAME
  3. .B ait
  4. \- small yet mighty GNU Emacs style editor
  5. .SH SYNOPSIS
  6. .B ait
  7. .B [-hv]
  8. .br
  9. .br
  10. .B ait
  11. .B [-b backup_dir]
  12. .B [-s switch_command]
  13. .br
  14. .in 11
  15. .B [-S shell_command]
  16. .B [-O open_command]
  17. [\fI\,file\/\fR [+/-\fI\,number\/\fR] ...]
  18. .SH DESCRIPTION
  19. .B ait
  20. is intended to be small, portable, and powerful Emacs-like text editor. While
  21. those are the top 3 main goals,
  22. .B ait
  23. also is intended to be simple in both implemetation and use, support the most
  24. important GNU Emacs keybindings, support UTF8 and unicode, to not reinvent
  25. the wheel, and to be stable. You will find many differences between GNU Emacs
  26. and
  27. .B ait
  28. as
  29. .B ait
  30. is
  31. .I not
  32. intended to be an Emacs clone. Some of the most prominent differences are:
  33. the lacks of a config, of lisp, of 100% custom window layouts, of major syntax
  34. highlighting, and of modes in general. You'll also find that
  35. .B ait
  36. doesn't treat the
  37. .B MSGLINE
  38. as its own buffer. This keeps the interface simple and less complicated.
  39. .B ait
  40. instead is simple enough that you can change the source to change the
  41. keybindings, uses the existing system as the extension language (see
  42. \fBSHELL COMMANDS\fR), uses a simple static-window system that works for 99% of all editing
  43. purposes, and supports the bare-minimum syntax highlighting (see
  44. \fBSYNTAX HIGHLIGHTING\fR). Think of
  45. .B ait
  46. as a microEMACS implementation of GNU Emacs with concepts from Plan 9's acme
  47. editor.
  48. .TP
  49. The options are as follows:
  50. .TP
  51. \fB+/- number\fR
  52. Go to the line specified by number (do not insert a space between the '+' or '-'
  53. sign and the number). If a negative number is specified, the line number counts
  54. backwards from the end of the file i.e. -1 will be the last line of the file,
  55. -2 will be second last, and so on.
  56. .TP
  57. \fB-v\fR
  58. Print version and exit
  59. .TP
  60. \fB-h\fR
  61. Print help and exit
  62. .TP
  63. \fB-b backup_dir\fR
  64. Supply a directory to place the backups.
  65. .TP
  66. \fB-s switch_command\fR
  67. Supply a custom command, in your PATH, to switch buffers with. This command should
  68. accept the list of buffers in a newline seperated list and should return just the
  69. buffer name, exactly as it was, followed by a newline character. The newline
  70. charcter generally will be added automatically by most programs. This option is
  71. useful if you wish to have fuzzy-searching or something else special that isn't
  72. supported by the minimal interface provided by the msgline. Generally, speaking
  73. this command isn't used all the time as it requires another keybinding just to
  74. access it. See section
  75. .B KEYBINDINGS
  76. sub-section
  77. .B C-x b
  78. for how to use it.
  79. .TP
  80. \fB-S shell_command\fR
  81. Supply a default shell command. The command must be in your PATH. This command
  82. will show as the default option when using
  83. .B esc x
  84. or shell-command. See section
  85. .B SHELL COMMANDS
  86. for more information.
  87. .TP
  88. \fB-O open_command\fR
  89. Supply a default open command. The command must be in your PATH. This command
  90. will show as the default option when using
  91. .B esc o
  92. or open-command. See section
  93. .B SHELL COMMANDS
  94. for more information.
  95. .TP
  96. .SH POINT & MARK
  97. .B ait
  98. is written using a gap buffer and therefore some of the lingo used to describe
  99. various behaviors come from this. The
  100. .I point
  101. is the location of the cursor in the buffer. The
  102. .I mark
  103. is a point that is set by the user to define either the beginning or end of the
  104. \fIregion\fR.
  105. The region is used for a variety of functions such as cut, copy, and
  106. shell-command. The point and mark are both buffer specific. Each time the a mark
  107. is added, it is added to a mark history. The poptomark command will allow you
  108. to jump to previous marks using this history.
  109. There are some note-worthy special cases that may confuse users at first.
  110. Firstly, persistent column. If you haven't explicitly changed the current
  111. column using something fwd-word, back-char, etc.
  112. .B ait
  113. will remember which column you're on. This makes editing things that are
  114. in the same column but seperated by short lines a lot easier. Secondly,
  115. brack-matching is supported for all heterogeneous bracket types (), {}, <>,
  116. and []. It is not supported for homogeneous ones ("", '', ``). You can, however,
  117. still use forward-bracket and backward-bracket to jump to them. Matched brackets
  118. are highlighted in magenta. If you've just typed the closing or opening bracket,
  119. .B ait
  120. will highlight the match in green until you move the cursor or the editor is
  121. repainted. Thirdly, regarding the forward/backward-bracket functions, if there
  122. is a mark they will overshoot to allow you to select the entire enclosed text
  123. and its brackets. For example, if you have the code (+ 1 2) and the point is on
  124. ( and you place a mark there and run forward-bracket, the point will actually go
  125. one character to the right of the), effectively allow you to kill that entire
  126. block of code. If the point were on the ) and you place a mark there and run
  127. backward-bracket, the mark will be moved one character to the right of the ) and
  128. then the point moved to the (. The two previous cases only work when the point
  129. is on the bracket and not next to it like in GNU Emacs. If a line goes over the
  130. allotted column wide for a window, it will automatically line-wrap. To show
  131. this, the last character of the row will be highlighted yellow.
  132. .SH WINDOWS AND BUFFERS
  133. When a file is loaded into
  134. \fBait\fR, it is stored in a \fIbuffer\fR. This buffer may be displayed on the
  135. screen in more than one \fIwindow\fR. Each window is delineated by a
  136. .I modeline
  137. at the bottom. The modeline contains important information about the buffer
  138. inside the window. The second position in the modeline will contain an "O" if
  139. that buffer is in overwrite mode. If changes are made to a buffer, you will see
  140. an asterisk in the third position of that buffer's window's modeline. If a file
  141. is changed outside
  142. .B ait
  143. and its buffer is about to be changed,
  144. .B ait
  145. prompts if the change should go ahead (y), not go ahead (n) or if the buffer
  146. should be reverted (r) to the latest file on disk. The default buffer is called
  147. .I *scratch*
  148. and is not saved when you close the program. In the modeline you will also find
  149. the buffer name. This name is usually the same as the file's name unless there
  150. is another buffer loaded with the same file name. In that case, the buffer name
  151. will contain the directory name in the name i.e. dir/foo.txt. If another buffer
  152. contains the same previous directory, the sync will continue until a non-match
  153. is found. The file name usually contains the entire path to that file and is
  154. seen when you save the buffer. Next in the modeline is the row and
  155. column inside of parenthesis. Lastly, there is the percentage of the
  156. buffer you're viewing. If you're at the top and you can't page up
  157. anymore, you'll see TOP. If you can't page down anymore you'll see
  158. BOT. Otherwise, you'll see the percent.
  159. Unlike GNU Emacs,
  160. .B ait
  161. doesn't allow the user to make endless window configurations. There are only 8
  162. supported window modes: one, horizontal, vertical, triple horizontal, triple
  163. vertical, Fibonacci right, Fibonacci left, and quad. Horizontal and vertical
  164. mode are 2 window splits in the respective direction. The triple modes are
  165. the same as the previous just with 3 windows. Fibonacci modes are modes that
  166. have 2 small windows that make up the height of the third large window. It is
  167. called this because it resembles the first 3 squares in the Fibonacci sequence.
  168. Lastly, quad mode is a 4 window mode with 4 windows, one in each quadrant. Also
  169. unlike GNU Emacs, close-window doesn't exist. You can only change window modes
  170. and so the keybinding C-x 0 will take you back to one window mode. When you
  171. change modes
  172. .B ait
  173. will attempt to fill the windows by following the buffer trail (explained in the
  174. next parapgraph). This isn't always right but is extremely handy.
  175. The order of buffers and windows is not handled by any array or list. They are
  176. handled by pointers that point to other pointers, thus creating a "trail" of
  177. sorts. The buffer trail is the path to the order of the open buffers i.e.
  178. current-buffer(foo.txt->b_next(bar.txt)->b_next(README)->b_next(NULL). The
  179. list must always end with NULL.
  180. .SH MSGLINE
  181. Under all windows and modlines is the prompt area, namely, the \fImsgline\fR.
  182. This is where all non-editing input is handled. Unlike GNU Emacs, the msgline
  183. is not a buffer but a special place for messages and prompts. In most prompts,
  184. most of the basic movement keybindings are usable: backward-char, forward-char,
  185. back-word, fwd-word, delete, backspace, kill-line, beginning-of-line,
  186. end-of-line, back-word-delete, fwd-word-delete, and insert-control-char.
  187. .SH SPECIAL CHARACTERS
  188. There are some unique special things that you may seen while using
  189. .B ait
  190. that may spark a question. First, a tab character is denoted by a 4 space
  191. line yellow UTF-8 character. This makes it easy to see whether spaces or actual
  192. tabs are being used. This character doesn't show correctly when you're in the tty.
  193. Second, if control characters make it into the file they
  194. are denoted, as GNU Emacs does, by a ^ followed by the letter that corresponds
  195. to that control character in red foreground cololr. For example, the form feed
  196. control character (ASCII 0x0C) would show up as ^L because 0x4C is an L in
  197. ASCII. Third, trailing whitespace is denoted by a red background color but only
  198. shows when you are not at the end of the trailing space. Fourth, completely
  199. empty lines that contain no buffer data are denoted by a cyan tilde (~)
  200. similarly to how
  201. .B vi(1)
  202. does it. This makes it easy to see when you're at the bottom of the file
  203. visually. Alternatively one could use the modeline BOT string to obtain
  204. the same conclusion.
  205. .SH KEYBINDINGS
  206. Keybindings in
  207. .B ait
  208. are written similarly to other Emacs clones. "C" means control and "M" means
  209. meta. Therefore, "C-x" means control plus the x key and "M-x" means meta/alt plus
  210. the x key. Since
  211. .B ait
  212. is usable on pretty much any terminal, it was selected to use esc instead of "M" to
  213. describe meta. Therefore, "esc x" means the same as "M-x". The below list has
  214. the keybinding in bold, followed by the common name for the function that the
  215. keybinding runs, followed by a description on how that function works.
  216. .TP
  217. \fBC-a\fR
  218. beginning-of-line, move the point to the beginning of the line.
  219. .TP
  220. \fBC-b / left\fR
  221. backward-char, move the point to the left by 1 character.
  222. .TP
  223. \fBC-d / delete\fR
  224. delete, delete the character that the point is currently pointing to.
  225. .TP
  226. \fBC-e\fR
  227. end-of-line, move the point to the end of the line.
  228. .TP
  229. \fBC-f / right\fR
  230. foward-char, move the point to the right by 1 character.
  231. .TP
  232. \fBC-h / backspace\fR
  233. backspace, delete the character directly to the left of the point.
  234. .TP
  235. \fBC-i\fR
  236. indent, insert 2 spaces.
  237. .TP
  238. \fBC-k\fR
  239. kill-to-eol, cut from the point to the end of the line.
  240. .TP
  241. \fBC-l\fR
  242. recenter, jump the page from top, middle, and end of the window following this
  243. cycle: middle, top, end, repeat.
  244. .TP
  245. \fBC-x u / C-/\fR
  246. undo, unlimited linear undo. See
  247. .B UNDO & REDO
  248. for more information.
  249. .TP
  250. \fBC-n / down\fR
  251. next-line, move the point down by 1 line.
  252. .TP
  253. \fBC-m / enter\fR
  254. newline, insert a newline character at the point.
  255. .TP
  256. \fBC-p / up\fR
  257. previous-line, moved the point up by 1 line.
  258. .TP
  259. \fBC-q\fR
  260. insert-control-char, prompts you in insert a control character. If you insert an invalid one, it will put '^@' (string terminator)
  261. .TP
  262. \fBC-r\fR
  263. reverse-isearch, prompt the user for a search query and search start at the
  264. point going up. See the section
  265. .B ISEARCH
  266. for more information.
  267. .TP
  268. \fBC-o\fR
  269. newline-below, insert a newline character at the end of the current line.
  270. .TP
  271. \fBC-s\fR
  272. reverse-isearch, prompt the user for a search query and search start at the
  273. point going down. See the section
  274. .B ISEARCH
  275. for more information.
  276. .TP
  277. \fBC-t\fR
  278. transpose, flip the position of the character at the point with the character
  279. directly to the left of it.
  280. .TP
  281. \fBC-u\fR
  282. universal-argument, at the moment all this does is run certain commands
  283. 4^(number of C-u presses) times. In Emacs, universal-argument does much more
  284. and
  285. .B ait
  286. does have a framework to do more with it but isn't fully implemented due to lack
  287. of necessity.
  288. .TP
  289. \fBC-v / pagedown\fR
  290. forward-page, move the page by one full page down.
  291. .TP
  292. \fBC-w / esc k\fR
  293. kill-region, cut the region. See
  294. .B POINT AND MARK
  295. and
  296. .B KILL RING
  297. for more information.
  298. .TP
  299. \fBC-y\fR
  300. yank, insert the scrap at the point. If you apply the universal argument to this
  301. command it will yank from the kill ring. See
  302. .B POINT AND MARK
  303. and
  304. .B KILL RING
  305. for more information.
  306. .TP
  307. \fBC-z\fR
  308. suspend, suspend
  309. .B ait
  310. .
  311. .TP
  312. \fBC-space / esc @\fR
  313. set-mark, set the point as the current mark.
  314. .TP
  315. \fBC-g / C-x C-g\fR
  316. remove-mark, remove the current mark. C-g is also used to quit any command
  317. in
  318. .B ait
  319. .
  320. .TP
  321. \fBC-x 0 / C-x 1\fR
  322. delete-other-window, return to one window mode.
  323. .TP
  324. \fBC-x 2\fR
  325. split-window, split into horizontal window mode.
  326. .TP
  327. \fBC-x 3\fR
  328. chop-window, split into vertical window mode.
  329. .TP
  330. \fBC-x 4\fR
  331. tri-split, split into triple horizontal window mode.
  332. .TP
  333. \fBC-x 5\fR
  334. tri-chop, split into triple vertical window mode.
  335. .TP
  336. \fBC-x 6\fR
  337. fib-right, split into Fibonacci right mode.
  338. .TP
  339. \fBC-x 7\fR
  340. fib-left, split into Fibonacci left mode.
  341. .TP
  342. \fBC-x 8\fR
  343. quad-window, split into quad window mode.
  344. .TP
  345. \fBC-x o\fR
  346. other-window, jump cursor to the next window in the window trail. See
  347. .B WINDOWS AND BUFFERS
  348. for more information.
  349. .TP
  350. \fBC-x =\fR
  351. cursor-position, print information on current cusor location to the msgline.
  352. .TP
  353. \fBC-x i\fR
  354. insert-file, insert a file into the current buffer.
  355. .TP
  356. \fBC-x k\fR
  357. kill-buffer, kill the current buffer. If unsaved, prompt to save.
  358. .TP
  359. \fBC-x C-n / C-x n\fR
  360. next-buffer, switch to the next buffer in the buffer trail. See
  361. .B WINDOWS AND BUFFERS
  362. for more information.
  363. .TP
  364. \fBC-x l\fR
  365. last-buffer, switch to the last buffer you previous had as the current.
  366. .TP
  367. \fBC-x b\fR
  368. switch-to-buffer, prompt the user to select which buffer they'd like to switch to.
  369. If the the user inputs C-c while being prompted to switch buffer,
  370. it
  371. .B ait
  372. will attempt to run the switch command. If there is not one supplied, a simple
  373. numerical selection will occur. The switch command can handled the ! character
  374. at the start of the command if you need to control the command more. Unlike
  375. shell and open commands, these commands cannot use the @, #, and $ special
  376. characters.
  377. .TP
  378. \fBC-x (\fR
  379. start-kbd-macro, begin a keyboard macro. See
  380. .B KEYBOARD MACROS
  381. for more information.
  382. .TP
  383. \fBC-x )\fR
  384. end-kbd-macro, end a keyboard macro. See
  385. .B KEYBOARD MACROS
  386. for more information.
  387. .TP
  388. \fBC-x e\fR
  389. run-kbd-macro, execute a keyboard macro. See
  390. .B KEYBOARD MACROS
  391. for more information.
  392. .TP
  393. \fBC-x C-f\fR
  394. find-file, prompt the user to select a file to open.
  395. .TP
  396. \fBC-x C-s\fR
  397. save-buffer, save the current buffer to disk.
  398. .TP
  399. \fBC-x C-w\fR
  400. write-file, save the current buffer to a new file.
  401. .TP
  402. \fBC-x C-c\fR
  403. exit, quit
  404. .B ait
  405. .
  406. .TP
  407. \fBC-x C-x\fR
  408. pop-to-mark, jump point to previous mark points.
  409. .TP
  410. \fBC-x C-; / C-x ;\fR
  411. comment, if there is a single line comment string for the current file
  412. extension, add it to the beginning of the line. If there is a region and
  413. there are multi-line comment strings for the current file extension, put
  414. the start comment delimiter at the top and the end at the bottom of the
  415. region. If the current line is a comment, remove it. If the point is
  416. within a multi-line comment, remove the multi-line comment. If you supply
  417. a universal argument while a region is set, it will comment out the region
  418. using single line comments. If you supply a universal argument and attempt
  419. to comment a line, it will create an empty multi-line comment. This is
  420. handy for making documentation above functions. This command functions
  421. much differently than GNU Emacs.
  422. .TP
  423. \fBC-x :\fR
  424. comment-at-eol, put a single line comment string at the end of the line
  425. .TP
  426. \fBesc 0\fR
  427. numeric-arg-0, see
  428. .B NUMERIC ARGUMENT
  429. for more information.
  430. .TP
  431. \fBesc 1\fR
  432. numeric-arg-1, see
  433. .B NUMERIC ARGUMENT
  434. for more information.
  435. .TP
  436. \fBesc 2\fR
  437. numeric-arg-2, see
  438. .B NUMERIC ARGUMENT
  439. for more information.
  440. .TP
  441. \fBesc 3\fR
  442. numeric-arg-3, see
  443. .B NUMERIC ARGUMENT
  444. for more information.
  445. .TP
  446. \fBesc 4\fR
  447. numeric-arg-4, see
  448. .B NUMERIC ARGUMENT
  449. for more information.
  450. .TP
  451. \fBesc 5\fR
  452. numeric-arg-5, see
  453. .B NUMERIC ARGUMENT
  454. for more information.
  455. .TP
  456. \fBesc 6\fR
  457. numeric-arg-6, see
  458. .B NUMERIC ARGUMENT
  459. for more information.
  460. .TP
  461. \fBesc 7\fR
  462. numeric-arg-7, see
  463. .B NUMERIC ARGUMENT
  464. for more information.
  465. .TP
  466. \fBesc 8\fR
  467. numeric-arg-8, see
  468. .B NUMERIC ARGUMENT
  469. for more information.
  470. .TP
  471. \fBesc 9\fR
  472. numeric-arg-9, see
  473. .B NUMERIC ARGUMENT
  474. for more information.
  475. .TP
  476. \fBesc b\fR
  477. back-word, move point to the left by one word.
  478. .TP
  479. \fBesc bksp\fR
  480. back-word-delete, delete one word to the left. See
  481. .B WORD DELETE
  482. and
  483. .B KILL RING
  484. for more information.
  485. .TP
  486. \fBesc f\fR
  487. fwd-word, move point to the right by one word.
  488. .TP
  489. \fBesc d\fR
  490. fwd-word-delete, delete one word to the right. See
  491. .B WORD DELETE
  492. and
  493. .B KILL RING.
  494. for more information.
  495. .TP
  496. \fBesc x\fR
  497. execute-shell-cmd, execute a shell command. See
  498. .B SHELL COMMANDS
  499. for more information.
  500. .TP
  501. \fBesc X\fR
  502. execute-control-cmd, execute a control command. See
  503. .B SHELL COMMANDS
  504. for more information.
  505. .TP
  506. \fBesc g\fR
  507. goto-line, prompt the user to select which line to jump to.
  508. .TP
  509. \fBesc G\fR
  510. goto-column, prompt the user to select which column to jump to.
  511. .TP
  512. \fBesc r\fR
  513. jump-to-row, jump to a line on the current page by pressing the
  514. combination of chars displayed on that line.
  515. .TP
  516. \fBesc j\fR
  517. jump-word, jump to a word on the current page starting with the input
  518. char by pressing the combination of chars displayed at the start of
  519. that word.
  520. .TP
  521. \fBesc i\fR
  522. indent, insert a tab character at the point.
  523. .TP
  524. \fBesc m\fR
  525. back-to-indentation, jump point to the next non-whitespace character.
  526. .TP
  527. \fBesc n\fR
  528. negate, set the negate flag. This isn't used much and almost no commands use it.
  529. I've found it more valuable to have custom keybindings to run commands in
  530. reverse.
  531. .TP
  532. \fBesc o\fR
  533. open-shell-cmd, execute a shell command to open a new buffer. See
  534. .B SHELL COMMANDS
  535. for more information.
  536. .TP
  537. \fBesc %\fR
  538. query-replace, prompt the user to replace something in the buffer. See
  539. .B QUERY REPLACE
  540. for more information.
  541. .TP
  542. \fBesc v / pageup\fR
  543. backward-page, move the page by one full page up.
  544. .TP
  545. \fBesc w\fR
  546. copy-region, copy the region. See
  547. .B POINT AND MARK
  548. and
  549. .B KILL RING
  550. for more information.
  551. .TP
  552. \fBesc < / home\fR
  553. beg-of-buf, set point to the beginning of the buffer.
  554. .TP
  555. \fBesc > / end\fR
  556. end-of-buf, set point to the end of the buffer.
  557. .TP
  558. \fBesc \\\fR
  559. delete-between, delete all whitespace to the right and left of the point.
  560. If the point is in the middle of a word (any where but the first and last
  561. char of the word), it will delete the word. It acts as if you typed
  562. `esc f esc backsp`. If you use the universal argument, this command can be
  563. used like vim(1) `i` text object selection and will delete the contents
  564. inside the bracket. You can jump over matching brackets by adding more
  565. universal arguments. For example, if you wanted to jump in-between a string
  566. and delete its contents but you aren't inside it. You'd want to have at
  567. least 2 universal arguments. This is due to the quotes being homogeneous.
  568. .TP
  569. \fBesc /\fR
  570. redo, redo an undo. You an redo as many undos as there are. See
  571. .B UNDO & REDO
  572. for more information.
  573. .TP
  574. \fBesc .\fR
  575. dynamic-expand, perform dynamic expansion on the word that the point is to the
  576. right of. This will search the buffer from point backwards until it reaches
  577. the point again for anything word in the buffer that contains the word to the
  578. right of the point. If there are no matches, the msgline will say so. If
  579. you've looped around back to the point, you will get the same message as if
  580. there are no matches. If you press the keybinding again, it will go around
  581. again. Note that it will only match words one time and skip over any
  582. duplicates.
  583. .TP
  584. \fBesc t\fR
  585. transpose word, flip the word the point is currently in the the word to the left.
  586. .TP
  587. \fBesc l\fR
  588. lowercase-word, make the next word (starting at the point) lowercase.
  589. .TP
  590. \fBesc c\fR
  591. capitalize-word, capitalize the next word (starting at the point).
  592. .TP
  593. \fBesc u\fR
  594. uppercase-word, make the next word (starting at the point) uppercase.
  595. .TP
  596. \fBesc ;\fR
  597. jump-to-char, prompt the user to select a character to the right of the point
  598. to jump the point to.
  599. .TP
  600. \fBesc :\fR
  601. negated-jump-to-char, prompt the user to select a character to the left of the
  602. point to jump the point to.
  603. .TP
  604. \fBesc z\fR
  605. zap-to-char, delete all characters to the right until the point reaches the
  606. insert character. If the universal argument is applied, it will zap to the
  607. char but not the char.
  608. .TP
  609. \fBesc Z\fR
  610. negated-zap-to-char, delete all characters to the left until the point reaches the
  611. insert character. If the universal argument is applied, it will zap to the
  612. char but not the char.
  613. .TP
  614. \fBinsert\fR
  615. toggle-overwrite-mode, toggle between insert and overwrite mode.
  616. .TP
  617. \fBC-M-f\fR
  618. foward-bracket, jump the point to the match of the bracket at the
  619. point going to the right.
  620. .TP
  621. \fBC-M-b\fR
  622. backward-bracket, jump the point to the match of the bracket at the
  623. point going to the left.
  624. .TP
  625. .SH ISEARCH
  626. isearch stands for incremental search and is the normal way to search for
  627. something in a buffer. isearch has two modes: isearch and isearch-reverse.
  628. isearch goes down the buffer and reverse goes up. It is paramount that you
  629. understand how the prompt for isearch works to use it to it's best ability.
  630. While in the isearch function is running, you have a few keybindings at your
  631. disposal other than the normal msgline keybinds:
  632. .TP
  633. \fBesc / C-g\fR
  634. Quit. This will take you back to the original start point.
  635. .TP
  636. \fBC-s\fR
  637. Jump to next match. If in isearch-reverse, switch to isearch.
  638. .TP
  639. \fBC-r\fR
  640. Jump to next match. If in isearch, switch to isearch-reverse.
  641. .TP
  642. \fBenter\fR
  643. Accept match, quit isearch, and stay at that point.
  644. .TP
  645. .PP
  646. Once you've reached a point where there are no more matches, pressing the
  647. respective keybind (C-s in isearch, C-r in isearch-reverse) will continue the
  648. search from the beginning or end of the buffer respectively. Lastly, if you type
  649. an all lowercase query it will search for matches
  650. \fIregardless of case;\fP meaning that it searches with case insensitivity.
  651. If you put any uppercase letter into the query, the search now becomes case
  652. sensitive.
  653. .SH UNDO & REDO
  654. It's not overtly obvious when a undo set happens, the explanation is quick. An
  655. undo set happens whenever you break a chain of similar commands - if you are
  656. typing a big paragraph but don't manually move the cursor, delete
  657. anything, or run any other commands you'll find the undo will remove that entire
  658. paragraph. This is because you haven't broken the chain of commands. A redo
  659. only becomes available once you've undone something.
  660. .SH NUMERICAL ARGUMENT
  661. Numerical argument is a way to run a keybinding many times. It is most useful
  662. when used in combination with keyboard macros but can also be nice when doing
  663. normal editting as well. When you begin entering a numeric argument you'll see
  664. "C-u x", where x is the number you've added, in the msgline. Upon entering the
  665. next number you will find that it doesn't add to the original number but rather
  666. shifts the original number into the next most significant digit. This makes it
  667. very easy to do massive recurring edits.
  668. .SH QUERY REPLACE
  669. The query-replace function is useful to replace multiple occurances of something
  670. with another something. This function is very straightforward on how to use so
  671. an explanation isn't needed. Once in the search, 'y' will accept the replace,
  672. replace the query with the replacement, and move to the next match; 'n' will
  673. skip the current match, '!' will accept all occurances without asking, and 'q'
  674. will quit. You may also use C-g to quit before you get to searching part or
  675. C-g and enter in the searching part. If there are more instances of the query,
  676. you may use 'l' (stands for last) to replace the current result and then quit.
  677. This is useful when you want to just replace a handful but don't want to be
  678. jumped to the next result.
  679. .SH WORD DELETE
  680. Similarly to GNU Emacs, if you consecutively execute the fwd-/back-word-delete
  681. commannds, it will add each new cut word to the scrap. Also, the undo/redo
  682. commands will undo these consecutive commands in 1 use similarly to how it works
  683. with consecutive character input or deletion.
  684. .SH KEYBOARD MACROS
  685. Also similar to GNU Emacs (and many other editors),
  686. .B ait
  687. can collect keyboard data into a keyboard macro. This feature does not record
  688. everything but most commands can be used with it. You must first start recording
  689. by executing start-kbd-macro. You will see a K in the modeline of the current
  690. buffer where the O for overwrite mode would be. Then perform the actions you
  691. wish to run later. All editing and movement commands can be recorded. File,
  692. buffer, suspend, and the like commands cannot be recorded, for obvious reasons.
  693. Once recording is finished, run the end-kbd-macro command. You can then execute
  694. it with execute-kbd-macro.
  695. .SH KILL RING
  696. Every time you cut (sometimes referred to as kill) some text, it gets placed
  697. into the scrap buffer. This buffer is placed into the kill ring once it is
  698. overwritten. The kill ring is a list of previously cut, or killed, data from the
  699. scrap buffer. You can recall this data by using the universal argument on the
  700. yank command. Each universal argument represents the next item in the kill ring.
  701. Most of the time you'll need something that you recently yanked and will only
  702. have to use 1, 2 or, at most 3 universal arguments. This feature is very handy
  703. and allows you to kill text without having to worry about yanking it somewhere
  704. else while you do some other editing.
  705. .SH SHELL COMMANDS
  706. One of the most powerful features in
  707. .B ait
  708. is the support to open files using custom commands and running shell commands.
  709. When running a shell command (esc x) there are 2 types: input and replace. Input
  710. happens when you have no region and you want to input the output of a command.
  711. One of the best uses of this is with xclip(1), xsel(1) or pbpaste(1) (on macOS)
  712. allowing you to paste in the editor. Replace happens when there is a region. In
  713. a region command the region is passed into the shell command and the output of
  714. that command, unless empty (just contains a null terminator or newline), is
  715. then placed where the region was. One of the best uses of this is a spell
  716. checker or, once again, by using system clipboard commands.
  717. .B ait
  718. ships with an example script called "spell" that uses this technique, however,
  719. it requires pick(1) and aspell(1) to be installed. Shell command also allows
  720. you to input the current buffer's filename (including its path), line number,
  721. and column number by placing a single @, #, or $, respectively. For example,
  722. "cat @" would translate to "cat /path/to/foo.txt".
  723. .B ait
  724. will not get confused if you supply an environment variable such as $LANG or
  725. if you escape the symbol via backslash(\) such as \@ or \$. One last thing to
  726. note about shell-command is that these programs are run synchronously and will
  727. block the use of
  728. .B ait
  729. until it's finished.
  730. open-command (esc o) is very straightforward, use anything you want to find the file
  731. you want to open and make a script that returns just the file and path. You can have
  732. .B ait
  733. open the file at a certain line number if the filename is appended with a colon,
  734. followed by the line number. This makes it easier to work with standard commands such
  735. as grep(1)'s -n option. The caveat to this is that you cannot use open-command to open
  736. files that have a colon in the file name. While this is non-standard, it's worth
  737. mentioning.
  738. .B ait
  739. ships with a few examples of this "ff" (find file) and "gg" (git grep) which
  740. both require pick(1) and git(1) to be installed.
  741. There may, in the future, be a way to have commands that don't effect the buffer
  742. or commands that effect the entire buffer added in later version.
  743. One very important note is that
  744. .B ait
  745. uses the
  746. .B system(3)
  747. function and directs the output into a temp file at /tmp/ait-temp.txt. The file
  748. is then read by
  749. .B ait
  750. and that's how it gets the output. Using
  751. .B system(3)
  752. is really handy because it allow certain programs to work better than when
  753. .B ait
  754. used
  755. .B popen(3)
  756. . One such program is xclip(1). Sometimes you want to write a script that
  757. outputs something via
  758. .B echo(1)
  759. but in doing so the echoed text will be output to the temp file. You can
  760. prevent this from happening by writing the script like normal and then
  761. just echoing the output you want directly to /tmp/ait-temp.txt. Then, in
  762. .B ait
  763. when you wish to run the script, prefix the entire command with !. This special
  764. character tells
  765. .B ait
  766. to not write the output to the temp file and expects the script to handle it
  767. itself. For example:
  768. #!/bin/sh
  769. echo "1. option one"
  770. echo "2. option two"
  771. echo "3. option three"
  772. read -p "> " output
  773. echo "$output" > /tmp/ait-temp.txt
  774. EOF
  775. When you run a shell/open command, the command is placed into a history
  776. array. You can tranverse this list by using up/down arrows or C-p/C-n.
  777. .SH SYNTAX HIGHLIGHTING
  778. While
  779. .B ait
  780. supports syntax highlighting, it only supports the bare minimum of it. The reason
  781. for this is that syntax highlighting that hightlights too much isn't helpful. Instead
  782. .B ait
  783. uses an extremely simple and straight-forward syntax highlighting approach that is
  784. designed to be simple in implementation to avoid complexity in the code. Most of
  785. the time, the syntax highlighting just highlights keywords in the language. It does
  786. so by looking at the file extension or filename so if the file lacks an extension
  787. or name found in the list, you sadly won't get highlighting. How to create new modes
  788. can be found in the syntax.h file of the project and will not be explained here.
  789. .SH TAB COMPLETION
  790. While prompting for a file, buffer, or shell command one can use the tab key or
  791. C-i to preform some basic tab completion. In the file prompt, one you're in a
  792. directory tabbing will cause the next alphabetic file or directory to populate.
  793. You can continue to press tab to go down the line. Note that you can type more
  794. and it will change the completion to fit that newly typed text. Once you get to
  795. the end, it will loop back. If you've come across a directory, you will need to
  796. press return or another character to use the tab completion inside of that
  797. directory. When prompted for a buffer, it works exactly the same except there are
  798. no directories. When prompted for a shell command via the shell-command or
  799. open-command commands, it will search your PATH environment variable for matches
  800. and loop around again if nothing is found. It's very important to note that tab
  801. completion only ever works when you're at the end of the msgline buffer.
  802. .SH BACKUP FILES
  803. Backups are created right before the buffer is written to disk. They contain the
  804. file's contents before it is overwritten.
  805. Backup files usually end in ~ and are, by default, placed in the working
  806. directory. You can optionally set a backup directory with the -b option.
  807. Backups that are sent to the the backup directory contain the entire path with
  808. the slashes replaced with exclamation points i.e. /home/foobar/foo.txt ->
  809. !home!foobar!foo.txt. The best way to use this is by setting an alias for in
  810. your .profile for each user.
  811. .SH AUTHOR
  812. .B ait
  813. is a fork of an editor called atto. Atto was a fork of an editor called AE.
  814. From Atto's README: "Atto is based on the public domain code of Anthony Howe's
  815. editor (commonly known as Anthony's Editor or AE, [2])..."
  816. That being said, parts of
  817. .B ait
  818. are written by all three of us: Anthony Howe,
  819. Hugh Barney, and Kevin Bloom.
  820. Kevin Bloom is the current maintainer.
  821. .SH KNOWN ISSUES
  822. You may view and track issues here: https://notabug.org/nuclearkev/ait/issues.
  823. Combined emojis will also cause the modeline to claim you're column
  824. number is 1 more than it really is. This is caused by the extra emoji
  825. and invisible combinator character. This bug is so minimal I don't
  826. find the need to fix it at this point.
  827. As of right now FreeBSD, OpenBSD, and GNU/Linux with muslc are not actively
  828. tested. There may or may not be many bugs on those systems. ait is known to
  829. not compile on SmartOS and likely other solaris-like operating systems. This
  830. is due to something in termbox2.
  831. .SH "REPORTING BUGS"
  832. Report bugs to https://notabug.org/nuclearkev/ait/issues
  833. .SH COPYRIGHT
  834. Public Domain 1991, 1993 by Anthony Howe. No warranty.
  835. Public Domain 2014-2022 by Hugh Barney. No warranty
  836. Copyright \(co 2023-2025 Kevin "The Nuclear" Bloom.
  837. .B ait
  838. comes with ABSOLUTELY NO WARRANTY.
  839. You may redistribute copies of
  840. .B ait
  841. under the terms of the BSD 3-Clause License.
  842. For more information about these matters, see the file named LICENSE.
  843. .SH "SEE ALSO"
  844. .BR mg (1),
  845. .BR emacs (1).
  846. .BR vi (1).