My attempt to optimize my emacs load time <1 second
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

938 lines
28 KiB

  1. This is /Users/leviolson/.emacs.d/straight/build/ivy/ivy.info, produced
  2. by makeinfo version 4.8 from
  3. /Users/leviolson/.emacs.d/straight/repos/swiper/doc/ivy.texi.
  4. Ivy manual, version 0.13.0
  5. Ivy is an interactive interface for completion in Emacs. Emacs uses
  6. completion mechanism in a variety of contexts: code, menus, commands,
  7. variables, functions, etc. Completion entails listing, sorting,
  8. filtering, previewing, and applying actions on selected items. When
  9. active, `ivy-mode' completes the selection process by narrowing
  10. available choices while previewing in the minibuffer. Selecting the
  11. final candidate is either through simple keyboard character inputs or
  12. through powerful regular expressions.
  13. Copyright (C) 2015-2019 Free Software Foundation, Inc.
  14. Permission is granted to copy, distribute and/or modify this
  15. document under the terms of the GNU Free Documentation License,
  16. Version 1.3 or any later version published by the Free Software
  17. Foundation; with no Invariant Sections, no Front-Cover Texts, and
  18. no Back-Cover Texts. A copy of the license is included in the
  19. section entitled "GNU Free Documentation License".
  20. INFO-DIR-SECTION Emacs
  21. START-INFO-DIR-ENTRY
  22. * Ivy: (ivy). Using Ivy for completion.
  23. END-INFO-DIR-ENTRY
  24. 
  25. File: ivy.info, Node: Top, Next: Introduction, Up: (dir)
  26. Ivy User Manual
  27. ***************
  28. * Menu:
  29. * Introduction::
  30. * Installation::
  31. * Getting started::
  32. * Key bindings::
  33. * Completion Styles::
  34. * Customization::
  35. * Commands::
  36. * API::
  37. * Variable Index::
  38. * Keystroke Index::
  39. --- The Detailed Node Listing ---
  40. Installation
  41. * Installing from Emacs Package Manager::
  42. * Installing from the Git repository::
  43. Getting started
  44. * Basic customization::
  45. Key bindings
  46. * Global key bindings::
  47. * Minibuffer key bindings::
  48. Minibuffer key bindings
  49. * Key bindings for navigation::
  50. * Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
  51. * Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
  52. * Key bindings that alter the minibuffer input::
  53. * Other key bindings::
  54. * Hydra in the minibuffer::
  55. * Saving the current completion session to a buffer::
  56. Completion Styles
  57. * ivy--regex-plus::
  58. * ivy--regex-ignore-order::
  59. * ivy--regex-fuzzy::
  60. Customization
  61. * Faces::
  62. * Defcustoms::
  63. * Actions::
  64. * Packages::
  65. Actions
  66. * What are actions?::
  67. * How can different actions be called?::
  68. * How to modify the actions list?::
  69. * Example - add two actions to each command::
  70. * Example - define a new command with several actions::
  71. Example - add two actions to each command
  72. * How to undo adding the two actions::
  73. * How to add actions to a specific command::
  74. Example - define a new command with several actions
  75. * Test the above function with `ivy-occur'::
  76. Commands
  77. * File Name Completion::
  78. * Buffer Name Completion::
  79. * Counsel commands::
  80. File Name Completion
  81. * Using TRAMP::
  82. API
  83. * Required arguments for `ivy-read'::
  84. * Optional arguments for `ivy-read'::
  85. * Example - `counsel-describe-function'::
  86. * Example - `counsel-locate'::
  87. * Example - `ivy-read-with-extra-properties'::
  88. 
  89. File: ivy.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top
  90. 1 Introduction
  91. **************
  92. Ivy is for quick and easy selection from a list. When Emacs prompts for
  93. a string from a list of several possible choices, Ivy springs into
  94. action to assist in narrowing and picking the right string from a vast
  95. number of choices.
  96. Ivy strives for minimalism, simplicity, customizability and
  97. discoverability.
  98. Minimalism
  99. ..........
  100. Uncluttered minibuffer is minimalism. Ivy shows the completion
  101. defaults, the number of matches, and 10 candidate matches below the
  102. input line. Customize `ivy-height' to adjust the number of candidate
  103. matches displayed in the minibuffer.
  104. Simplicity
  105. ..........
  106. Simplicity is about Ivy's behavior in the minibuffer. It is also about
  107. the code interface to extend Ivy's functionality. The minibuffer area
  108. behaves as close to `fundamental-mode' as possible. `SPC' inserts a
  109. space, for example, instead of being bound to the more complex
  110. `minibuffer-complete-word'. Ivy's code uses easy-to-examine global
  111. variables; avoids needless complications with branch-introducing custom
  112. macros.
  113. Customizability
  114. ...............
  115. Customizability is about being able to use different methods and
  116. interfaces of completion to tailor the selection process. For example,
  117. adding a custom display function that points to a selected candidate
  118. with `>', instead of highlighting the selected candidate with the
  119. `ivy-current-match' face (see `ivy-format-functions-alist'). Or take
  120. the customization of actions, say after the candidate function is
  121. selected. `RET' uses `counsel-describe-function' to describe the
  122. function, whereas `M-o d' jumps to that function's definition in the
  123. code. The `M-o' prefix can be uniformly used with characters like `d' to
  124. group similar actions.
  125. Discoverability
  126. ...............
  127. Ivy displays easily discoverable commands through the hydra facility.
  128. `C-o' in the minibuffer displays a hydra menu. It opens up within an
  129. expanded minibuffer area. Each menu item comes with short documentation
  130. strings and highlighted one-key completions. So discovering even seldom
  131. used keys is simply a matter of `C-o' in the minibuffer while in the
  132. midst of the Ivy interaction. This discoverability minimizes exiting
  133. Ivy interface for documentation look-ups.
  134. 
  135. File: ivy.info, Node: Installation, Next: Getting started, Prev: Introduction, Up: Top
  136. 2 Installation
  137. **************
  138. Install Ivy automatically through Emacs's package manager, or manually
  139. from Ivy's development repository.
  140. Emacs 24.3 is the oldest version to run Ivy. Emacs 24.4 is the oldest
  141. version that runs Ivy with fancy faces display.
  142. * Menu:
  143. * Installing from Emacs Package Manager::
  144. * Installing from the Git repository::
  145. 
  146. File: ivy.info, Node: Installing from Emacs Package Manager, Next: Installing from the Git repository, Up: Installation
  147. 2.1 Installing from Emacs Package Manager
  148. =========================================
  149. `M-x' `package-install' `RET' `ivy' `RET'
  150. Ivy is installed as part of `ivy' package, which is available from
  151. two different package archives, GNU ELPA and MELPA. For the latest
  152. stable version, use the GNU ELPA archives using the above M-x command.
  153. For current hourly builds, use the MELPA archives. In MELPA, Ivy is
  154. split into three packages: `ivy', `swiper' and `counsel'; you can simply
  155. install `counsel' which will bring in the other two as dependencies.
  156. See the code below for adding MELPA to the list of package archives:
  157. (require 'package)
  158. (add-to-list 'package-archives
  159. '("melpa" . "https://melpa.org/packages/"))
  160. After this do `M-x' `package-refresh-contents' `RET', followed by
  161. `M-x' `package-install' `RET' `counsel' `RET'.
  162. For package manager details, see *Note Packages: (emacs)Packages.
  163. 
  164. File: ivy.info, Node: Installing from the Git repository, Prev: Installing from Emacs Package Manager, Up: Installation
  165. 2.2 Installing from the Git repository
  166. ======================================
  167. Why install from Git?
  168. .....................
  169. * No need to wait for MELPA's hourly builds
  170. * Easy to revert to previous versions
  171. * Contribute to Ivy's development; send patches; pull requests
  172. Configuration steps
  173. ...................
  174. First clone the Swiper repository with:
  175. cd ~/git && git clone https://github.com/abo-abo/swiper
  176. cd swiper && make compile
  177. Second, add these lines to the Emacs init file:
  178. (add-to-list 'load-path "~/git/swiper/")
  179. (require 'ivy)
  180. Then, update the code with:
  181. git pull
  182. make
  183. 
  184. File: ivy.info, Node: Getting started, Next: Key bindings, Prev: Installation, Up: Top
  185. 3 Getting started
  186. *****************
  187. First enable Ivy completion everywhere:
  188. (ivy-mode 1)
  189. Note: `ivy-mode' can be toggled on and off with `M-x' `ivy-mode'.
  190. * Menu:
  191. * Basic customization::
  192. 
  193. File: ivy.info, Node: Basic customization, Up: Getting started
  194. 3.1 Basic customization
  195. =======================
  196. Here are some basic settings particularly useful for new Ivy users:
  197. (setq ivy-use-virtual-buffers t)
  198. (setq ivy-count-format "(%d/%d) ")
  199. If you want, you can go without any customizations at all. The above
  200. settings are the most bang for the buck in terms of customization. So
  201. users that typically don't like customize a lot are advised to look at
  202. these settings first.
  203. For more advanced customizations, refer to `M-x describe-variable'
  204. documentation.
  205. 
  206. File: ivy.info, Node: Key bindings, Next: Completion Styles, Prev: Getting started, Up: Top
  207. 4 Key bindings
  208. **************
  209. * Menu:
  210. * Global key bindings::
  211. * Minibuffer key bindings::
  212. 
  213. File: ivy.info, Node: Global key bindings, Next: Minibuffer key bindings, Up: Key bindings
  214. 4.1 Global key bindings
  215. =======================
  216. Here is a list of commands that are useful to be bound globally, along
  217. with some sample bindings:
  218. Ivy-based interface to standard commands
  219. ........................................
  220. (global-set-key (kbd "C-s") 'swiper-isearch)
  221. (global-set-key (kbd "M-x") 'counsel-M-x)
  222. (global-set-key (kbd "C-x C-f") 'counsel-find-file)
  223. (global-set-key (kbd "M-y") 'counsel-yank-pop)
  224. (global-set-key (kbd "<f1> f") 'counsel-describe-function)
  225. (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
  226. (global-set-key (kbd "<f1> l") 'counsel-find-library)
  227. (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
  228. (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
  229. (global-set-key (kbd "<f2> j") 'counsel-set-variable)
  230. (global-set-key (kbd "C-x b") 'ivy-switch-buffer)
  231. (global-set-key (kbd "C-c v") 'ivy-push-view)
  232. (global-set-key (kbd "C-c V") 'ivy-pop-view)
  233. Ivy-based interface to shell and system tools
  234. .............................................
  235. (global-set-key (kbd "C-c c") 'counsel-compile)
  236. (global-set-key (kbd "C-c g") 'counsel-git)
  237. (global-set-key (kbd "C-c j") 'counsel-git-grep)
  238. (global-set-key (kbd "C-c L") 'counsel-git-log)
  239. (global-set-key (kbd "C-c k") 'counsel-rg)
  240. (global-set-key (kbd "C-c m") 'counsel-linux-app)
  241. (global-set-key (kbd "C-c n") 'counsel-fzf)
  242. (global-set-key (kbd "C-x l") 'counsel-locate)
  243. (global-set-key (kbd "C-c J") 'counsel-file-jump)
  244. (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
  245. (global-set-key (kbd "C-c w") 'counsel-wmctrl)
  246. Ivy-resume and other commands
  247. .............................
  248. `ivy-resume' resumes the last Ivy-based completion.
  249. (global-set-key (kbd "C-c C-r") 'ivy-resume)
  250. (global-set-key (kbd "C-c b") 'counsel-bookmark)
  251. (global-set-key (kbd "C-c d") 'counsel-descbinds)
  252. (global-set-key (kbd "C-c g") 'counsel-git)
  253. (global-set-key (kbd "C-c o") 'counsel-outline)
  254. (global-set-key (kbd "C-c t") 'counsel-load-theme)
  255. (global-set-key (kbd "C-c F") 'counsel-org-file)
  256. You can also enable `counsel-mode' to make some global key binding
  257. remapping for you.
  258. 
  259. File: ivy.info, Node: Minibuffer key bindings, Prev: Global key bindings, Up: Key bindings
  260. 4.2 Minibuffer key bindings
  261. ===========================
  262. Ivy includes several minibuffer bindings, which are defined in the
  263. `ivy-minibuffer-map' keymap variable. The most frequently used ones are
  264. described here.
  265. `swiper' or `counsel-M-x' add more key bindings through the `keymap'
  266. argument to `ivy-read'. These keys, also active in the minibuffer, are
  267. described under their respective commands.
  268. A key feature of `ivy-minibuffer-map' is its full editing capability
  269. where the familiar `C-a', `C-f', `M-d', `M-DEL', `M-b', `M-w', `C-k',
  270. `C-y' key bindings work the same as in `fundamental-mode'.
  271. * Menu:
  272. * Key bindings for navigation::
  273. * Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
  274. * Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
  275. * Key bindings that alter the minibuffer input::
  276. * Other key bindings::
  277. * Hydra in the minibuffer::
  278. * Saving the current completion session to a buffer::
  279. 
  280. File: ivy.info, Node: Key bindings for navigation, Next: Key bindings for single selection action then exit minibuffer, Up: Minibuffer key bindings
  281. 4.2.1 Key bindings for navigation
  282. ---------------------------------
  283. * `C-n' (`ivy-next-line') selects the next candidate
  284. * `C-p' (`ivy-previous-line') selects the previous candidate
  285. * `M-<' (`ivy-beginning-of-buffer') selects the first candidate
  286. * `M->' (`ivy-end-of-buffer') selects the last candidate
  287. * `C-v' (`ivy-scroll-up-command') scrolls up by `ivy-height' lines
  288. * `M-v' (`ivy-scroll-down-command') scrolls down by `ivy-height'
  289. lines
  290. -- User Option: ivy-wrap
  291. Specifies the wrap-around behavior for `C-n' and `C-p'. When
  292. `ivy-wrap' is set to `t', `ivy-next-line' and `ivy-previous-line'
  293. will cycle past the last and the first candidates respectively.
  294. Wrap-around behavior is off by default.
  295. -- User Option: ivy-height
  296. Use this option to adjust the minibuffer height, which also
  297. affects scroll size when using `C-v' and `M-v' key bindings.
  298. `ivy-height' is 10 lines by default.
  299. 
  300. File: ivy.info, Node: Key bindings for single selection action then exit minibuffer, Next: Key bindings for multiple selections and actions keep minibuffer open, Prev: Key bindings for navigation, Up: Minibuffer key bindings
  301. 4.2.2 Key bindings for single selection, action, then exit minibuffer
  302. ---------------------------------------------------------------------
  303. Ivy can offer several actions from which to choose which action to run.
  304. This "calling an action" operates on the selected candidate. For
  305. example, when viewing a list of files, one action could open it for
  306. editing, one to view it, another to invoke a special function, and so
  307. on. Custom actions can be added to this interface. The precise action
  308. to call on the selected candidate can be delayed until after the
  309. narrowing is completed. No need to exit the interface if unsure which
  310. action to run. This delayed flexibility and customization of actions
  311. extends usability of lists in Emacs.
  312. `C-m' or `RET' (`ivy-done')
  313. ...........................
  314. Calls the default action and then exits the minibuffer.
  315. `M-o' (`ivy-dispatching-done')
  316. ..............................
  317. Presents valid actions from which to choose. When only one action is
  318. available, there is no difference between `M-o' and `C-m'.
  319. `C-j' (`ivy-alt-done')
  320. ......................
  321. When completing file names, selects the current directory candidate and
  322. starts a new completion session there. Otherwise, it is the same as
  323. `ivy-done'.
  324. `TAB' (`ivy-partial-or-done')
  325. .............................
  326. Attempts partial completion, extending current input as much as
  327. possible. `TAB TAB' is the same as `C-j' (`ivy-alt-done').
  328. Example ERT test:
  329. (should
  330. (equal (ivy-with
  331. '(progn
  332. (ivy-read "Test: " '("can do" "can't, sorry" "other"))
  333. ivy-text)
  334. "c <tab>")
  335. "can"))
  336. `C-M-j' (`ivy-immediate-done')
  337. ..............................
  338. Exits with _the current input_ instead of _the current candidate_ (like
  339. other commands).
  340. This is useful e.g. when you call `find-file' to create a new file,
  341. but the desired name matches an existing file. In that case, using
  342. `C-j' would select that existing file, which isn't what you want - use
  343. this command instead.
  344. `C-'' (`ivy-avy')
  345. .................
  346. Uses avy to select one of the candidates on the current candidate page.
  347. This can often be faster than multiple `C-n' or `C-p' keystrokes
  348. followed by `C-m'.
  349. 
  350. File: ivy.info, Node: Key bindings for multiple selections and actions keep minibuffer open, Next: Key bindings that alter the minibuffer input, Prev: Key bindings for single selection action then exit minibuffer, Up: Minibuffer key bindings
  351. 4.2.3 Key bindings for multiple selections and actions, keep minibuffer open
  352. ----------------------------------------------------------------------------
  353. For repeatedly applying multiple actions or acting on multiple
  354. candidates, Ivy does not close the minibuffer between commands. It
  355. keeps the minibuffer open for applying subsequent actions.
  356. Adding an extra meta key to the normal key chord invokes the special
  357. version of the regular commands that enables applying multiple actions.
  358. `C-M-m' (`ivy-call')
  359. ....................
  360. Is the non-exiting version of `C-m' (`ivy-done').
  361. Instead of closing the minibuffer, `C-M-m' allows selecting another
  362. candidate or another action. For example, `C-M-m' on functions list
  363. invokes `describe-function'. When combined with `C-n', function
  364. descriptions can be invoked quickly in succession.
  365. `C-M-o' (`ivy-dispatching-call')
  366. ................................
  367. Is the non-exiting version of `M-o' (`ivy-dispatching-done').
  368. For example, during the `counsel-rhythmbox' completion, press `C-M-o
  369. e' to en-queue the selected candidate, followed by `C-n C-m' to
  370. play the next candidate - the current action reverts to the default one
  371. after `C-M-o'.
  372. `C-M-n' (`ivy-next-line-and-call')
  373. ..................................
  374. Combines `C-n' and `C-M-m'. Moves to next line and applies an action.
  375. Comes in handy when opening multiple files from `counsel-find-file',
  376. `counsel-git-grep', `counsel-ag', `counsel-rg', or `counsel-locate'
  377. lists. Just hold `C-M-n' for rapid-fire default action on each
  378. successive element of the list.
  379. `C-M-p' (`ivy-previous-line-and-call')
  380. ......................................
  381. Combines `C-p' and `C-M-m'.
  382. Similar to the above except it moves through the list in the other
  383. direction.
  384. `ivy-resume'
  385. ............
  386. Recalls the state of the completion session just before its last exit.
  387. Useful after an accidental `C-m' (`ivy-done').
  388. 
  389. File: ivy.info, Node: Key bindings that alter the minibuffer input, Next: Other key bindings, Prev: Key bindings for multiple selections and actions keep minibuffer open, Up: Minibuffer key bindings
  390. 4.2.4 Key bindings that alter the minibuffer input
  391. --------------------------------------------------
  392. `M-n' (`ivy-next-history-element')
  393. ..................................
  394. Cycles forward through the Ivy command history.
  395. Ivy updates an internal history list after each action. When this
  396. history list is empty, `M-n' inserts symbol (or URL) at point into the
  397. minibuffer.
  398. `M-p' (`ivy-previous-history-element')
  399. ......................................
  400. Cycles forward through the Ivy command history.
  401. `M-i' (`ivy-insert-current')
  402. ............................
  403. Inserts the current candidate into the minibuffer.
  404. Useful for copying and renaming files, for example: `M-i' to insert
  405. the original file name string, edit it, and then `C-m' to complete the
  406. renaming.
  407. `M-j' (`ivy-yank-word')
  408. .......................
  409. Inserts the sub-word at point into the minibuffer.
  410. This is similar to `C-s C-w' with `isearch'. Ivy reserves `C-w' for
  411. `kill-region'. See also `ivy-yank-symbol' and `ivy-yank-char'.
  412. `S-SPC' (`ivy-restrict-to-matches')
  413. ...................................
  414. Deletes the current input, and resets the candidates list to the
  415. currently restricted matches.
  416. This is how Ivy provides narrowing in successive tiers.
  417. `C-r' (`ivy-reverse-i-search')
  418. ..............................
  419. Starts a recursive completion session through the command's history.
  420. This works just like `C-r' at the bash command prompt, where the
  421. completion candidates are the history items. Upon completion, the
  422. selected candidate string is inserted into the minibuffer.
  423. 
  424. File: ivy.info, Node: Other key bindings, Next: Hydra in the minibuffer, Prev: Key bindings that alter the minibuffer input, Up: Minibuffer key bindings
  425. 4.2.5 Other key bindings
  426. ------------------------
  427. `M-w' (`ivy-kill-ring-save')
  428. ............................
  429. Copies selected candidates to the kill ring.
  430. Copies the region if the region is active.
  431. 
  432. File: ivy.info, Node: Hydra in the minibuffer, Next: Saving the current completion session to a buffer, Prev: Other key bindings, Up: Minibuffer key bindings
  433. 4.2.6 Hydra in the minibuffer
  434. -----------------------------
  435. `C-o' (`hydra-ivy/body')
  436. ........................
  437. Invokes the hydra menu with short key bindings.
  438. When Hydra is active, minibuffer editing is disabled and menus
  439. display short aliases:
  440. Short Normal Command name
  441. ------------------------------------------------
  442. `o' `C-g' `keyboard-escape-quit'
  443. `j' `C-n' `ivy-next-line'
  444. `k' `C-p' `ivy-previous-line'
  445. `h' `M-<' `ivy-beginning-of-buffer'
  446. `l' `M->' `ivy-end-of-buffer'
  447. `d' `C-m' `ivy-done'
  448. `f' `C-j' `ivy-alt-done'
  449. `g' `C-M-m' `ivy-call'
  450. `u' `C-c C-o' `ivy-occur'
  451. Hydra reduces key strokes, for example: `C-n C-n C-n C-n' is `C-o
  452. jjjj' in Hydra.
  453. Hydra menu offers these additional bindings:
  454. `c' (`ivy-toggle-calling')
  455. ..........................
  456. Toggle calling the action after each candidate change. It modifies `j'
  457. to `jg', `k' to `kg' etc.
  458. `m' (`ivy-rotate-preferred-builders')
  459. .....................................
  460. Rotate the current regexp matcher.
  461. `>' (`ivy-minibuffer-grow')
  462. ...........................
  463. Increase `ivy-height' for the current minibuffer.
  464. `<' (`ivy-minibuffer-shrink')
  465. .............................
  466. Decrease `ivy-height' for the current minibuffer.
  467. `w' (`ivy-prev-action')
  468. .......................
  469. Select the previous action.
  470. `s' (`ivy-next-action')
  471. .......................
  472. Select the next action.
  473. `a' (`ivy-read-action')
  474. .......................
  475. Use a menu to select an action.
  476. `C' (`ivy-toggle-case-fold')
  477. ............................
  478. Toggle case folding (match both upper and lower case characters for
  479. lower case input).
  480. Hydra menu also offers bindings for marking multiple candidates:
  481. Key Command name
  482. --------------------------------
  483. `m' `ivy-mark'
  484. `u' `ivy-unmark'
  485. `DEL' `ivy-unmark-backward'
  486. `t' `ivy-toggle-marks'
  487. The action is called on each marked candidate one by one.
  488. 
  489. File: ivy.info, Node: Saving the current completion session to a buffer, Prev: Hydra in the minibuffer, Up: Minibuffer key bindings
  490. 4.2.7 Saving the current completion session to a buffer
  491. -------------------------------------------------------
  492. `C-c C-o' (`ivy-occur')
  493. .......................
  494. Saves the current candidates to a new buffer and exits completion.
  495. The new buffer is read-only and has a few useful bindings defined.
  496. `RET' or `f' (`ivy-occur-press')
  497. ................................
  498. Call the current action on the selected candidate.
  499. `mouse-1' (`ivy-occur-click')
  500. .............................
  501. Call the current action on the selected candidate.
  502. `j' (`next-line')
  503. .................
  504. Move to next line.
  505. `k' (`previous-line')
  506. .....................
  507. Move to previous line.
  508. `a' (`ivy-occur-read-action')
  509. .............................
  510. Read an action and make it current for this buffer.
  511. `o' (`ivy-occur-dispatch')
  512. ..........................
  513. Read an action and call it on the selected candidate.
  514. `q' (`quit-window')
  515. ...................
  516. Bury the current buffer.
  517. Ivy has no limit on the number of active buffers like these.
  518. Ivy takes care of naming buffers uniquely by constructing descriptive
  519. names. For example: `*ivy-occur counsel-describe-variable "function$*'.
  520. 
  521. File: ivy.info, Node: Completion Styles, Next: Customization, Prev: Key bindings, Up: Top
  522. 5 Completion Styles
  523. *******************
  524. Ivy's completion functions rely on a regex builder - a function that
  525. transforms a string input to a string regex. All current candidates
  526. simply have to match this regex. Each collection can be assigned its
  527. own regex builder by customizing `ivy-re-builders-alist'.
  528. The keys of this alist are collection names, and the values are one
  529. of the following:
  530. * `ivy--regex'
  531. * `ivy--regex-plus'
  532. * `ivy--regex-ignore-order'
  533. * `ivy--regex-fuzzy'
  534. * `regexp-quote'
  535. A catch-all key, `t', applies to all collections that don't have
  536. their own key.
  537. The default is:
  538. (setq ivy-re-builders-alist
  539. '((t . ivy--regex-plus)))
  540. This example shows a custom regex builder assigned to file name
  541. completion:
  542. (setq ivy-re-builders-alist
  543. '((read-file-name-internal . ivy--regex-fuzzy)
  544. (t . ivy--regex-plus)))
  545. Here, `read-file-name-internal' is a function that is passed as the
  546. second argument to `completing-read' for file name completion.
  547. The regex builder resolves as follows (in order of priority):
  548. 1. `re-builder' argument passed to `ivy-read'.
  549. 2. `collection' argument passed to `ivy-read' is a function and has an
  550. entry on `ivy-re-builders-alist'.
  551. 3. `caller' argument passed to `ivy-read' has an entry on
  552. `ivy-re-builders-alist'.
  553. 4. `this-command' has an entry on `ivy-re-builders-alist'.
  554. 5. `t' has an entry on `ivy-re-builders-alist'.
  555. 6. `ivy--regex'.
  556. * Menu:
  557. * ivy--regex-plus::
  558. * ivy--regex-ignore-order::
  559. * ivy--regex-fuzzy::
  560. 
  561. File: ivy.info, Node: ivy--regex-plus, Next: ivy--regex-ignore-order, Up: Completion Styles
  562. 5.1 ivy-regex-plus
  563. ==================
  564. `ivy--regex-plus' is Ivy's default completion method.
  565. `ivy--regex-plus' matches by splitting the input by spaces and
  566. rebuilding it into a regex.
  567. As the search string is typed in Ivy's minibuffer, it is transformed
  568. into valid regex syntax. If the string is `"for example"', it is
  569. transformed into
  570. "\\(for\\).*\\(example\\)"
  571. which in regex terminology matches `"for"' followed by a wild card
  572. and then `"example"'. Note how Ivy uses the space character to build
  573. wild cards. To match a literal white space, use an extra space. So to
  574. match one space type two spaces, to match two spaces type three spaces,
  575. and so on.
  576. As Ivy transforms typed characters into regex strings, it provides an
  577. intuitive feedback through font highlights.
  578. Ivy supports regexp negation with `"!"'. For example, `"define key
  579. ! ivy quit"' first selects everything matching `"define.*key"', then
  580. removes everything matching `"ivy"', and finally removes everything
  581. matching `"quit"'. What remains is the final result set of the negation
  582. regexp.
  583. Since Ivy treats minibuffer input as a regexp, the standard regexp
  584. identifiers work: `"^"', `"$"', `"\b"' or `"[a-z]"'. The exceptions are
  585. spaces, which translate to `".*"', and `"!"' that signal the beginning
  586. of a negation group.
  587. 
  588. File: ivy.info, Node: ivy--regex-ignore-order, Next: ivy--regex-fuzzy, Prev: ivy--regex-plus, Up: Completion Styles
  589. 5.2 ivy-regex-ignore-order
  590. ==========================
  591. `ivy--regex-ignore-order' ignores the order of regexp tokens when
  592. searching for matching candidates. For instance, the input `"for
  593. example"' will match `"example test for"'.
  594. 
  595. File: ivy.info, Node: ivy--regex-fuzzy, Prev: ivy--regex-ignore-order, Up: Completion Styles
  596. 5.3 ivy-regex-fuzzy
  597. ===================
  598. `ivy--regex-fuzzy' splits each character with a wild card. Searching
  599. for `"for"' returns all `"f.*o.*r"' matches, resulting in a large
  600. number of hits. Yet some searches need these extra hits. Ivy sorts
  601. such large lists using `flx' package's scoring mechanism, if it's
  602. installed.
  603. `C-o m' toggles the current regexp builder.
  604. 
  605. File: ivy.info, Node: Customization, Next: Commands, Prev: Completion Styles, Up: Top
  606. 6 Customization
  607. ***************
  608. * Menu:
  609. * Faces::
  610. * Defcustoms::
  611. * Actions::
  612. * Packages::
  613. 
  614. File: ivy.info, Node: Faces, Next: Defcustoms, Up: Customization
  615. 6.1 Faces
  616. =========
  617. `ivy-current-match'
  618. ...................
  619. Highlights the currently selected candidate.
  620. `ivy-minibuffer-match-face-1'
  621. .............................
  622. Highlights the background of the match.
  623. `ivy-minibuffer-match-face-2'
  624. .............................
  625. Highlights the first (modulo 3) matched group.
  626. `ivy-minibuffer-match-face-3'
  627. .............................
  628. Highlights the second (modulo 3) matched group.
  629. `ivy-minibuffer-match-face-4'
  630. .............................
  631. Highlights the third (modulo 3) matched group.
  632. `ivy-confirm-face'
  633. ..................
  634. Highlights the "(confirm)" part of the prompt.
  635. When `confirm-nonexistent-file-or-buffer' set to `t', then
  636. confirming non-existent files in `ivy-mode' requires an additional
  637. `RET'.
  638. The confirmation prompt will use this face.
  639. For example:
  640. (setq confirm-nonexistent-file-or-buffer t)
  641. Then call `find-file', enter "eldorado" and press `RET' - the prompt
  642. will be appended with "(confirm)". Press `RET' once more to confirm, or
  643. any key to continue the completion.
  644. `ivy-match-required-face'
  645. .........................