ait.1 28 KB

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