editrc.5 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. .TH EDITRC 5 "May 22, 2016" ""
  2. .SH NAME
  3. \fBeditrc\fP
  4. \- configuration file for editline library
  5. .SH SYNOPSIS
  6. .br
  7. \fBeditrc\fP
  8. .SH DESCRIPTION
  9. The
  10. \fBeditrc\fP
  11. file defines various settings to be used by the
  12. \fBeditline\fP(3)
  13. library.
  14. The format of each line is:
  15. [prog:]command [arg ...]
  16. \fIcommand\fP
  17. is one of the
  18. \fBeditline\fP(3)
  19. builtin commands.
  20. Refer to
  21. .B BUILTIN COMMANDS
  22. for more information.
  23. \fIprog\fP
  24. is the program name string that a program defines when it calls
  25. \fBel_init\fP(3)
  26. to set up
  27. \fBeditline\fP(3),
  28. which is usually
  29. \fIargv[0]\fP.
  30. \fIcommand\fP
  31. will be executed for any program which matches
  32. \fIprog\fP.
  33. \fIprog\fP
  34. may also be a
  35. \fBregex\fP(3)
  36. style
  37. regular expression, in which case
  38. \fIcommand\fP
  39. will be executed for any program that matches the regular expression.
  40. If
  41. \fIprog\fP
  42. is absent,
  43. \fIcommand\fP
  44. is executed for all programs.
  45. .SH BUILTIN COMMANDS
  46. The
  47. \fBeditline\fP
  48. library has some builtin commands, which affect the way
  49. that the line editing and history functions operate.
  50. These are based on similar named builtins present in the
  51. \fBtcsh\fP(1)
  52. shell.
  53. The following builtin commands are available:
  54. .TP
  55. \fBbind Oo Fl aeklrsv Oc [\fIkey\fP [\fIcommand]]\fP\fP
  56. Without options and arguments, list all bound keys and macros, and
  57. the editor command or input string to which each one is bound.
  58. If only
  59. \fIkey\fP
  60. is supplied, show the binding for that key or macro.
  61. If
  62. \fIkey\fP command
  63. is supplied, bind the editor
  64. \fIcommand\fP
  65. to that key or macro.
  66. The options are as follows:
  67. .RS
  68. .TP
  69. \fB\-a\fP
  70. List or change key bindings in the
  71. \fBvi\fP(1)
  72. mode alternate (command mode) key map.
  73. .TP
  74. \fB\-e\fP
  75. Bind all keys to the standard GNU Emacs-like bindings.
  76. .TP
  77. \fB\-k\fP
  78. \fIkey\fP
  79. is interpreted as a symbolic arrow key name, which may be one of
  80. `up',
  81. `down',
  82. `left'
  83. or
  84. `right'.
  85. .TP
  86. \fB\-l\fP
  87. List all editor commands and a short description of each.
  88. .TP
  89. \fB\-r\fP
  90. Remove the binding of the key or macro
  91. \fIkey\fP.
  92. .TP
  93. \fB\-s\fP
  94. Define a keyboard macro rather than a key binding or command macro:
  95. \fIcommand\fP
  96. is taken as a literal string and appended to the input queue whenever
  97. \fIkey\fP
  98. is typed.
  99. Bound keys and macros in
  100. \fIcommand\fP
  101. are themselves reinterpreted, and this continues for ten levels of
  102. interpretation.
  103. .TP
  104. \fB\-v\fP
  105. Bind all keys to the standard
  106. \fBvi\fP(1) -like
  107. bindings.
  108. .RE
  109. The
  110. \fBeditline\fP(7)
  111. manual documents all editor commands and contains more information
  112. about macros and the input queue.
  113. \fIkey\fP
  114. and
  115. \fIcommand\fP
  116. can contain control characters of the form
  117. `No'^\fIcharacter\fP
  118. (
  119. e.g.\&
  120. `^A'
  121. ),
  122. and the following backslashed escape sequences:
  123. .RS
  124. .TP
  125. \fB\ea\fP
  126. Bell
  127. .TP
  128. \fB\eb\fP
  129. Backspace
  130. .TP
  131. \fB\ee\fP
  132. Escape
  133. .TP
  134. \fB\ef\fP
  135. Formfeed
  136. .TP
  137. \fB\en\fP
  138. Newline
  139. .TP
  140. \fB\er\fP
  141. Carriage return
  142. .TP
  143. \fB\et\fP
  144. Horizontal tab
  145. .TP
  146. \fB\ev\fP
  147. Vertical tab
  148. .TP
  149. .B \e Ar nnn
  150. The ASCII character corresponding to the octal number
  151. \fInnn\fP.
  152. .RE
  153. `\e'
  154. nullifies the special meaning of the following character,
  155. if it has any, notably
  156. `\e'
  157. and
  158. `^'.
  159. .TP
  160. \fBechotc Oo Fl sv Oc \fIarg\fP \fI...\fP\fP
  161. Exercise terminal capabilities given in
  162. \fIarg\fP... .
  163. If
  164. \fIarg\fP
  165. is
  166. `baud',
  167. `cols',
  168. `lines',
  169. `rows',
  170. `meta',
  171. or
  172. `tabs',
  173. the value of that capability is printed, with
  174. ``yes''
  175. or
  176. ``no''
  177. indicating that the terminal does or does not have that capability.
  178. \fB\-s\fP
  179. returns an empty string for non-existent capabilities, rather than
  180. causing an error.
  181. \fB\-v\fP
  182. causes messages to be verbose.
  183. .TP
  184. \fBedit [Li on | Li off]\fP
  185. Enable or disable the
  186. \fBeditline\fP
  187. functionality in a program.
  188. .TP
  189. \fBhistory \fIlist\fP | \fIsize\fP Dv n | \fIunique\fP Dv n\fP
  190. The
  191. \fIlist\fP
  192. command lists all entries in the history.
  193. The
  194. \fIsize\fP
  195. command sets the history size to
  196. n
  197. entries.
  198. The
  199. \fIunique\fP
  200. command controls if history should keep duplicate entries.
  201. If
  202. n
  203. is non zero, only keep unique history entries.
  204. If
  205. n
  206. is zero, then keep all entries (the default).
  207. .TP
  208. \fBsettc \fIcap\fP \fIval\fP\fP
  209. Set the terminal capability
  210. \fIcap\fP
  211. to
  212. \fIval\fP,
  213. as defined in
  214. \fBtermcap\fP(5).
  215. No sanity checking is done.
  216. .TP
  217. \fBsetty Oo Fl a Oc Oo Fl d Oc Oo Fl q Oc Oo Fl x Oc Oo \fI+mode\fP Oc \\fP
  218. Oo Ar -mode Oc Oo Ar mode Oc Oo Ar char=c Oc
  219. Control which tty modes that
  220. \fBeditrc\fP
  221. won't allow the user to change.
  222. \fB\-d\fP,
  223. \fB\-q\fP
  224. or
  225. \fB\-x\fP
  226. tells
  227. \fBsetty\fP
  228. to act on the
  229. `edit',
  230. `quote'
  231. or
  232. `execute'
  233. set of tty modes respectively; defaulting to
  234. \fB\-x\fP.
  235. Without other arguments,
  236. \fBsetty\fP
  237. lists the modes in the chosen set which are fixed on
  238. (
  239. `+mode'
  240. )
  241. or off
  242. (
  243. `-mode'
  244. ).
  245. \fB\-a\fP
  246. lists all tty modes in the chosen set regardless of the setting.
  247. With
  248. \fI+mode\fP,
  249. \fI-mode\fP
  250. or
  251. \fImode\fP,
  252. fixes
  253. \fImode\fP
  254. on or off or removes control of
  255. \fImode\fP
  256. in the chosen set.
  257. \fBSetty\fP
  258. can also be used to set tty characters to particular values using
  259. \fIchar=value\fP.
  260. If
  261. \fIvalue\fP
  262. is empty
  263. then the character is set to
  264. _POSIX_VDISABLE .
  265. .TP
  266. \fBtelltc\fP
  267. List the values of all the terminal capabilities (see
  268. \fBtermcap\fP(5)) .
  269. .SH ENVIRONMENT
  270. .TP
  271. .B EDITRC
  272. Names the default configuration file for the
  273. \fBeditline\fP(3)
  274. library.
  275. .SH FILES
  276. .TP
  277. .B ~/.editrc
  278. Last resort, if no other file is specified,
  279. user configuration file for the
  280. \fBeditline\fP(3)
  281. library.
  282. .SH SEE ALSO
  283. \fBeditline\fP(3),
  284. \fBregex\fP(3),
  285. \fBtermcap\fP(5),
  286. \fBeditline\fP(7)
  287. .SH AUTHORS
  288. -nosplit
  289. The
  290. \fBeditline\fP
  291. library was written by
  292. Christos Zoulas ,
  293. and this manual was written by
  294. Luke Mewburn ,
  295. with some sections inspired by
  296. \fBtcsh\fP(1).