ait.1 28 KB

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