ait.1 23 KB

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