ait.1 24 KB

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