ait.1 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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. If you supply
  389. a universal argument while a region is set, it will comment out the region
  390. using single line comments. If you supply a universal argument and attempt
  391. to comment a line, it will create an empty multi-line comment. This is
  392. handy for making documentation above functions. This command functions
  393. much differently than GNU Emacs.
  394. .TP
  395. \fBesc 0\fR
  396. numeric-arg-0, see
  397. .B NUMERIC ARGUMENT
  398. for more information.
  399. .TP
  400. \fBesc 1\fR
  401. numeric-arg-1, see
  402. .B NUMERIC ARGUMENT
  403. for more information.
  404. .TP
  405. \fBesc 2\fR
  406. numeric-arg-2, see
  407. .B NUMERIC ARGUMENT
  408. for more information.
  409. .TP
  410. \fBesc 3\fR
  411. numeric-arg-3, see
  412. .B NUMERIC ARGUMENT
  413. for more information.
  414. .TP
  415. \fBesc 4\fR
  416. numeric-arg-4, see
  417. .B NUMERIC ARGUMENT
  418. for more information.
  419. .TP
  420. \fBesc 5\fR
  421. numeric-arg-5, see
  422. .B NUMERIC ARGUMENT
  423. for more information.
  424. .TP
  425. \fBesc 6\fR
  426. numeric-arg-6, see
  427. .B NUMERIC ARGUMENT
  428. for more information.
  429. .TP
  430. \fBesc 7\fR
  431. numeric-arg-7, see
  432. .B NUMERIC ARGUMENT
  433. for more information.
  434. .TP
  435. \fBesc 8\fR
  436. numeric-arg-8, see
  437. .B NUMERIC ARGUMENT
  438. for more information.
  439. .TP
  440. \fBesc 9\fR
  441. numeric-arg-9, see
  442. .B NUMERIC ARGUMENT
  443. for more information.
  444. .TP
  445. \fBesc b\fR
  446. back-word, move point to the left by one word.
  447. .TP
  448. \fBesc bksp\fR
  449. back-word-delete, delete one word to the left. See
  450. .B WORD DELETE
  451. and
  452. .B KILL RING
  453. for more information.
  454. .TP
  455. \fBesc f\fR
  456. fwd-word, move point to the right by one word.
  457. .TP
  458. \fBesc d\fR
  459. fwd-word-delete, delete one word to the right. See
  460. .B WORD DELETE
  461. and
  462. .B KILL RING.
  463. for more information.
  464. .TP
  465. \fBesc x\fR
  466. execute-shell-cmd, execute a shell command. See
  467. .B SHELL COMMANDS
  468. for more information.
  469. .TP
  470. \fBesc g\fR
  471. goto-line, prompt the user to select which line to jump to.
  472. .TP
  473. \fBesc G\fR
  474. goto-column, prompt the user to select which column to jump to.
  475. .TP
  476. \fBesc r\fR
  477. jump-to-row, jump to a line on the current page by pressing the
  478. combination of chars displayed on that line.
  479. .TP
  480. \fBesc j\fR
  481. jump-word, jump to a word on the current page starting with the input
  482. char by pressing the combination of chars displayed at the start of
  483. that word.
  484. .TP
  485. \fBesc i\fR
  486. indent, insert a tab character at the point.
  487. .TP
  488. \fBesc m\fR
  489. back-to-indentation, jump point to the next non-whitespace character.
  490. .TP
  491. \fBesc n\fR
  492. negate, set the negate flag. This isn't used much and almost no commands use it.
  493. I've found it more valuable to have custom keybindings to run commands in
  494. reverse.
  495. .TP
  496. \fBesc o\fR
  497. open-shell-cmd, execute a shell command to open a new buffer. See
  498. .B SHELL COMMANDS
  499. for more information.
  500. .TP
  501. \fBesc %\fR
  502. query-replace, prompt the user to replace something in the buffer. See
  503. .B QUERY REPLACE
  504. for more information.
  505. .TP
  506. \fBesc v / pageup\fR
  507. backward-page, move the page by one full page up.
  508. .TP
  509. \fBesc w\fR
  510. copy-region, copy the region. See
  511. .B POINT AND MARK
  512. and
  513. .B KILL RING
  514. for more information.
  515. .TP
  516. \fBesc < / home\fR
  517. beg-of-buf, set point to the beginning of the buffer.
  518. .TP
  519. \fBesc > / end\fR
  520. end-of-buf, set point to the end of the buffer.
  521. .TP
  522. \fBesc \\\fR
  523. delete-between, delete all whitespace to the right and left of the point.
  524. If the point is in the middle of a word (any where but the first and last
  525. char of the word), it will delete the word. It acts as if you typed
  526. `esc f esc backsp`. If you use the universal argument, this command can be
  527. used like vim(1) `i` text object selection and will delete the contents
  528. inside the bracket. You can jump over matching brackets by adding more
  529. universal arguments. For example, if you wanted to jump in-between a string
  530. and delete its contents but you aren't inside it. You'd want to have at
  531. least 2 universal arguments. This is due to the quotes being homogeneous.
  532. .TP
  533. \fBesc /\fR
  534. redo, redo an undo. You an redo as many undos as there are. See
  535. .B UNDO & REDO
  536. for more information.
  537. .TP
  538. \fBesc .\fR
  539. dynamic-expand, perform dynamic expansion on the word that the point is to the
  540. right of. This will search the buffer from point backwards until it reaches
  541. the point again for anything word in the buffer that contains the word to the
  542. right of the point. If there are no matches, the message line will say so. If
  543. you've looped around back to the point, you will get the same message as if
  544. there are no matches. If you press the keybinding again, it will go around
  545. again. Note that it will only match words one time and skip over any
  546. duplicates.
  547. .TP
  548. \fBesc t\fR
  549. transpose word, flip the word the point is currently in the the word to the left.
  550. .TP
  551. \fBesc l\fR
  552. lowercase-word, make the next word (starting at the point) lowercase.
  553. .TP
  554. \fBesc c\fR
  555. capitalize-word, capitalize the next word (starting at the point).
  556. .TP
  557. \fBesc u\fR
  558. uppercase-word, make the next word (starting at the point) uppercase.
  559. .TP
  560. \fBesc ;\fR
  561. jump-to-char, prompt the user to select a character to the right of the point
  562. to jump the point to.
  563. .TP
  564. \fBesc :\fR
  565. negated-jump-to-char, prompt the user to select a character to the left of the
  566. point to jump the point to.
  567. .TP
  568. \fBesc z\fR
  569. zap-to-char, delete all characters to the right until the point reaches the
  570. insert character. If the universal argument is applied, it will zap to the
  571. char but not the char.
  572. .TP
  573. \fBesc Z\fR
  574. negated-zap-to-char, delete all characters to the left until the point reaches the
  575. insert character. If the universal argument is applied, it will zap to the
  576. char but not the char.
  577. .TP
  578. \fBinsert\fR
  579. toggle-overwrite-mode, toggle between insert and overwrite mode.
  580. .TP
  581. \fBC-M-f\fR
  582. foward-bracket, jump the point to the match of the bracket at the
  583. point going to the right.
  584. .TP
  585. \fBC-M-b\fR
  586. backward-bracket, jump the point to the match of the bracket at the
  587. point going to the left.
  588. .TP
  589. .SH ISEARCH
  590. isearch stands for incremental search and is the normal way to search for
  591. something in a buffer. isearch has two modes: isearch and isearch-reverse.
  592. isearch goes down the buffer and reverse goes up. It is paramount that you
  593. understand how the prompt for isearch works to use it to it's best ability.
  594. While in the isearch function is running, you have a few keybindings at your
  595. disposal other than the normal msgline keybinds:
  596. .TP
  597. \fBesc / C-g\fR
  598. Quit. This will take you back to the original start point.
  599. .TP
  600. \fBC-s\fR
  601. Jump to next match. If in isearch-reverse, switch to isearch.
  602. .TP
  603. \fBC-r\fR
  604. Jump to next match. If in isearch, switch to isearch-reverse.
  605. .TP
  606. \fBenter\fR
  607. Accept match, quit isearch, and stay at that point.
  608. .TP
  609. .PP
  610. Once you've reached a point where there are no more matches, pressing the
  611. respective keybind (C-s in isearch, C-r in isearch-reverse) will continue the
  612. search from the beginning or end of the buffer respectively. Lastly, if you type
  613. an all lowercase query it will search for matches
  614. \fIregardless of case;\fP meaning that it searches with case insensitivity.
  615. If you put any uppercase letter into the query, the search now becomes case
  616. sensitive.
  617. .SH UNDO & REDO
  618. It's not overtly obvious when a undo set happens, the explanation is quick. An
  619. undo set happens whenever you break a chain of similar commands - if you are
  620. typing a big paragraph but don't manually move the cursor, delete
  621. anything, or run any other commands you'll find the undo will remove that entire
  622. paragraph. This is because you haven't broken the chain of commands. A redo
  623. only becomes available once you've undone something.
  624. .SH NUMERICAL ARGUMENT
  625. Numerical argument is a way to run a keybinding many times. It is most useful
  626. when used in combination with keyboard macros but can also be nice when doing
  627. normal editting as well. When you begin entering a numeric argument you'll see
  628. "C-u x", where x is the number you've added, in the msgline. Upon entering the
  629. next number you will find that it doesn't add to the original number but rather
  630. shifts the original number into the next most significant digit. This makes it
  631. very easy to do massive recurring edits.
  632. .SH QUERY REPLACE
  633. The query-replace function is useful to replace multiple occurances of something
  634. with another something. This function is very straightforward on how to use so
  635. an explanation isn't needed. Once in the search, 'y' will accept the replace,
  636. replace the query with the replacement, and move to the next match; 'n' will
  637. skip the current match, '!' will accept all occurances without asking, and 'q'
  638. will quit. You may also use C-g to quit before you get to searching part or
  639. C-g and enter in the searching part. If there are more instances of the query,
  640. you may use 'l' (stands for last) to replace the current result and then quit.
  641. This is useful when you want to just replace a handful but don't want to be
  642. jumped to the next result.
  643. .SH WORD DELETE
  644. Similarly to GNU Emacs, if you consecutively execute the fwd-/back-word-delete
  645. commannds, it will add each new cut word to the scrap. Also, the undo/redo
  646. commands will undo these consecutive commands in 1 use similarly to how it works
  647. with consecutive character input or deletion.
  648. .SH KEYBOARD MACROS
  649. Also similar to GNU Emacs (and many other editors),
  650. .B ait
  651. can collect keyboard data into a keyboard macro. This feature does not record
  652. everything but most commands can be used with it. You must first start recording
  653. by executing start-kbd-macro. You will see a K in the modeline of the current
  654. buffer where the O for overwrite mode would be. Then perform the actions you
  655. wish to run later. All editing and movement commands can be recorded. File,
  656. buffer, suspend, and the like commands cannot be recorded, for obvious reasons.
  657. Once recording is finished, run the end-kbd-macro command. You can then execute
  658. it with execute-kbd-macro.
  659. .SH KILL RING
  660. Every time you cut (sometimes referred to as kill) some text, it gets placed
  661. into the scrap buffer. This buffer is placed into the kill ring once it is
  662. overwritten. The kill ring is a list of previously cut, or killed, data from the
  663. scrap buffer. You can recall this data by using the universal argument on the
  664. yank command. Each universal argument represents the next item in the kill ring.
  665. Most of the time you'll need something that you recently yanked and will only
  666. have to use 1, 2 or, at most 3 universal arguments. This feature is very handy
  667. and allows you to kill text without having to worry about yanking it somewhere
  668. else while you do some other editing.
  669. .SH SHELL COMMANDS
  670. One of the most powerful features in
  671. .B ait
  672. is the support to open files using custom commands and running shell commands.
  673. When running a shell command (esc x) there are 2 types: input and replace. Input
  674. happens when you have no region and you want to input the output of a command.
  675. One of the best uses of this is with xclip(1) or pbpaste(1) (on macOS) allowing
  676. you to paste in the editor. Replace happens when there is a region. In a region
  677. command the region is passed into the shell command and the output of that command,
  678. unless empty (just contains a null terminator or newline), is then placed where
  679. the region was. One of the best uses of this is a spell checker.
  680. .B ait
  681. ships with an example script called "spell" that uses this technique, however,
  682. it requires pick(1) and aspell(1) to be installed.
  683. open-command (esc o) is very straightforward, use anything you want to find the file
  684. you want to open and make a script that returns just the file and path. You can have
  685. .B ait
  686. open the file at a certain line number if the filename is appended with a colon,
  687. followed by the line number. This makes it easier to work with standard commands such
  688. as grep(1)'s -n option. The caveat to this is that you cannot use open-command to open
  689. files that have a colon in the file name. While this is non-standard, it's worth
  690. mentioning.
  691. .B ait
  692. ships with a few examples of this "ff" (find file) and "gg" (git grep) which
  693. both require pick(1) and git(1) to be installed.
  694. There may, in the future, be a way to have commands that don't effect the buffer
  695. or commands that effect the entire buffer added in later version.
  696. .SH SYNTAX HIGHLIGHTING
  697. While
  698. .B ait
  699. supports syntax highlighting, it only supports the bare minimum of it. The reason
  700. for this is that syntax highlighting that hightlights too much isn't helpful. Instaed
  701. .B ait
  702. uses an extremely simple and straight-forward syntax highlighting approach that is
  703. designed to be simple in implementation to avoid complexity in the code. Most of
  704. the time, the syntax highlighting just highlights keywords in the language. It does
  705. so by looking at the file extension so if the file lacks an extension, you sadly
  706. won't get highlighting.
  707. .SH TAB COMPLETION
  708. While prompting for a file, buffer, or shell command one can use the tab key or
  709. C-i to preform some basic tab completion. In the file prompt, one you're in a
  710. directory tabbing will cause the next alphabetic file or directory to popular.
  711. You can continue to press tab to go down the line. Note that you can type more
  712. and it will change the completion to fit that newly typed text. Once you get to
  713. the end, it will loop back. If you've come across a directory, you will need to
  714. press return or another character to use the tab completion inside of that
  715. directory. When prompted for a buffer, it works exactly the same except there are
  716. no directories. When prompted for a shell command via the shell-command or
  717. open-command commands, it will search your PATH environment variable for matches
  718. and loop around again if nothing is found. It's very important to note that tab
  719. completion only ever works when you're at the end of the msgline buffer.
  720. .SH BACKUP FILES
  721. Backups are created right before the buffer is written to disk. They contain the
  722. file's contents before it is overwritten.
  723. Backup files usually end in ~ and are, by default, placed in the working
  724. directory. You can optionally set a backup directory with the -b option.
  725. Backups that are sent to the the backup directory contain the entire path with
  726. the slashes replaced with exclamation points i.e. /home/foobar/foo.txt ->
  727. !home!foobar!foo.txt. The best way to use this is by setting an alias for in
  728. your .profile for each user.
  729. .SH AUTHOR
  730. .B ait
  731. is a fork of an editor called atto. Atto was a fork of an editor called AE.
  732. From Atto's README: "Atto is based on the public domain code of Anthony Howe's
  733. editor (commonly known as Anthony's Editor or AE, [2])..."
  734. That being said, parts of
  735. .B ait
  736. are written by all three of us: Anthony Howe,
  737. Hugh Barney, and Kevin Bloom.
  738. Kevin Bloom is the current maintainer.
  739. .SH KNOWN ISSUES
  740. You may view and track issues here: https://notabug.org/nuclearkev/ait/issues.
  741. Combined emojis will also cause the modeline to claim you're column
  742. number is 1 more than it really is. This is caused by the extra emoji
  743. and invisible combinator character. This bug is so minimal I don't
  744. find the need to fix it at this point.
  745. If you set a mark and begin to delete or add text, the mark will move
  746. either backwards or fowards because the point for that mark is
  747. changing. You can see this behavior similarly when you have a region.
  748. While from a technical aspect this isn't actually a bug to the user
  749. this would appear to be one since the mark isn't "staying put."
  750. .SH "REPORTING BUGS"
  751. Report bugs to https://notabug.org/nuclearkev/ait/issues
  752. .SH COPYRIGHT
  753. Public Domain 1991, 1993 by Anthony Howe. No warranty.
  754. Public Domain 2014-2022 by Hugh Barney. No warranty
  755. Copyright \(co 2023-2024 Kevin "The Nuclear" Bloom.
  756. .B ait
  757. comes with ABSOLUTELY NO WARRANTY.
  758. You may redistribute copies of
  759. .B ait
  760. under the terms of the BSD 3-Clause License.
  761. For more information about these matters, see the file named LICENSE.
  762. .SH "SEE ALSO"
  763. .BR mg (1),
  764. .BR emacs (1).