Icicles - Key Bindings

iciclesimage
Previous: Icicles - File-Name Completion TipsIciclesIciclesIndexNext: Icicles - Customizing Key Bindings

You can easily customize any of the key bindings that Icicles uses – see Icicles - Customizing Key Bindings. I recommend that you first try using the default bindings, however. There are many Icicles key bindings (in particular in the minibuffer), but they are grouped into a few natural sets, to help you remember them. And there are user options available for easy key customization.

Global Bindings

Icicles does not change your global key bindings. It changes some minibuffer bindings, and it adds some minor-mode bindings for Icicle mode, but it does not change your global bindings.

There are two exceptions:

1. In Icicle mode, various Icicles commands are added to menu bar menus. File commands are added to the File menu, and so on, under an Icicles submenu. Those items that do not belong naturally to any existing menu-bar menu are added to a new top-level Icicles menu and to the existing Minibuf menu. Whatever the menu they appear in, however, Icicles menu items are visible only when Icicle mode is active.

If you do not want Icicles to add items to menus besides Minibuf and Icicles, then set option icicle-touche-pas-aux-menus to non-‘nil’. See Icicles - Customizing Key Bindings.

2. Icicles adds the key ‘S-TAB’ (bound to ‘icicle-complete-keys’) to each existing keymap. This allows you to complete keys in any keymap. For technical reasons, these bindings are not part of ‘icicle-mode-map’; other keymaps are enhanced to include this binding. However, this Icicles binding of ‘S-TAB’ never replaces any existing binding of ‘S-TAB’. See Icicles - Key Completion for more information about this use of ‘S-TAB’.

(The documentation always refers to the key that performs key completion as ‘S-TAB’. Actually, it is ‘S-TAB’ only by default. You can Customize it, using option icicle-key-complete-keys.)

Icicle-Mode Bindings

Most top-level Icicle-mode bindings are in the Icicles menu-bar menu. In addition, option icicle-top-level-key-bindings causes Icicles to bind some keyboard keys to some top-level Icicles commands. Some of these take the place of similar, global bindings whenever you are in Icicle mode. Typically, these top-level commands are Icicles multi-command versions of vanilla Emacs commands.

You can customize option ‘icicle-top-level-key-bindings’ to specify the top-level Icicles commands that you want to bind, and the keys you want to bind them to.

Here is a screenshot of part of the Customize buffer for option ‘icicle-top-level-key-bindings’, to give you an idea. You use INS to insert another binding and DEL to delete a binding. You type the key sequence you want in the Key field and its command in the Command field. As an alternative to specifying a key, you can choose Command to remap in the Value Menu and then enter the command you want to remap.

IciclesCustomizingKeys

With the default value of ‘icicle-top-level-key-bindings’, Icicles makes the following Icicle-mode bindings:

‘S-TAB’ is bound, in effect, to ‘icicle-complete-keys’, which completes a key sequence. Prefix keys followed by ‘S-TAB’ are also bound to ‘icicle-complete-keys’. (‘S-TAB’ is effectively bound to other commands in buffer ‘*Completions*’ and in the minibuffer.)

(The documentation always refers to the key that performs key completion as ‘S-TAB’. Actually, it is ‘S-TAB’ only by default. You can customize it, using option icicle-key-complete-keys.)

When ‘icicle-top-level-key-bindings’ has its default value, Icicles also substitutes all of the key bindings for some standard Emacs commands. For example, Icicles binds ‘icicle-buffer’ to all keys that are globally bound outside Icicle mode to standard command ‘switch-to-buffer’. By default, the following standard commands have their bindings co-opted this way by Icicles commands:

 Standard Command                   Icicles Command
 ‘abort-recursive-edit’.............‘icicle-abort-recursive-edit’ (‘C-]’)
 ‘bookmark-jump’....................‘icicle-bookmark’ (‘C-x r b’)
 ‘bookmark-jump-other-window’.......‘icicle-bookmark-other-window’ (‘C-x j j’)
 ‘bookmark-set’.....................‘icicle-bookmark-cmd’ (‘C-x r m’')
 ‘dabbrev-completion’...............‘icicle-dabbrev-completion’ (‘C-M-/’)
 ‘delete-window’....................‘icicle-delete-window’ (‘C-x 0’)
 ‘dired’............................‘icicle-dired’ (‘C-x d’)
 ‘dired-other-window’...............‘icicle-dired-other-window’ (‘C-x 4 d’)
 ‘eval-expression’..................‘icicle-pp-eval-expression’ (‘M-:’)
 ‘exchange-point-and-mark’..........‘icicle-exchange-point-and-mark’ (‘C-x C-x’)
 ‘execute-extended-command’.........‘icicle-execute-extended-command’ (‘M-x’)
 ‘find-file’........................‘icicle-file’ (‘C-x C-f’)
 ‘find-file-other-window’...........‘icicle-file-other-window’ (‘C-x 4 f’)
 ‘find-file-read-only’..............‘icicle-find-file-read-only’ (‘C-x C-r’)
 ‘find-file-read-only-other-window’.‘icicle-find-file-read-only-other-window’ (‘C-x 4 r’)
 ‘find-tag’.........................‘icicle-find-tag’ (‘M-.’)
 ‘find-tag-other-window’............‘icicle-find-first-tag-other-window’ (‘C-x 4 .’)
 ‘Info-goto-node’...................‘icicle-Info-goto-node’ (‘g’)
 ‘Info-index’.......................‘icicle-Info-index’ (‘i’)
 ‘Info-menu’........................‘icicle-Info-menu’ (‘m’)
 ‘insert-buffer’....................‘icicle-insert-buffer’ (‘C-S-insert’)
 ‘kill-buffer’......................‘icicle-kill-buffer’ (‘C-x k’)
 ‘lisp-complete-symbol’.............‘icicle-lisp-complete-symbol’ (‘M-TAB’)
 ‘other-frame’......................‘icicle-select-frame’ (‘C-x 5 o’)
 ‘other-window’.....................‘icicle-select-window-or-frame’ (‘C-x o’)
 ‘pop-global-mark’..................‘icicle-goto-global-marker-or-pop-global-mark’ (‘C-x C-SPC’)
 ‘pop-tag-mark’.....................‘icicle-pop-tag-mark’ (‘M-*’)
 ‘pp-eval-expression’...............‘icicle-pp-eval-expression’ (‘M-:’)
 ‘set-mark-command’.................‘icicle-goto-marker-or-set-mark-command’ (‘C-SPC’)
 ‘switch-to-buffer’.................‘icicle-buffer’ (‘C-x b’)
 ‘switch-to-buffer-other-window’....‘icicle-buffer-other-window’ (‘C-x 4 b’)
 ‘where-is’.........................‘icicle-where-is’ (‘C-h w’)
 ‘yank’.............................‘icicle-yank-maybe-completing’ (‘C-y’)
 ‘yank-pop’.........................‘icicle-yank-pop-commands’ (‘M-y’)

Actually, by default, Icicles binds ‘icicle-yank-maybe-completing’ to whatever the value of option icicle-yank-function is. By default, this value is ‘yank’.

The substitution of `icicle-dired(-other-window)’ for `dired(-other-window)’ happens by default only if you do not use library Dired+. If you do use Dired+’ then the commands are already Icicles multi-commands, and are especially powerful.

Option ‘icicle-top-level-key-bindings’ remaps not only these standard Emacs commands but also some commands provided by other libraries. For example, if you use package Bookmark+, then type-specific bookmark jump commands such as ‘bookmarkp-dired-jump-other-window’ are remapped to Icicles multi-command versions.

In addition, option icicle-functions-to-redefine redefines some vanilla functions to their Icicles versions while in Icicle mode. Any redefined functions that are bound to keys keep those bindings. For example, ‘Info-index’ is by default redefined to ‘icicle-Info-index’ in Icicle mode, so ‘i’ in InfoMode is effectively bound to ‘icicle-Info-index’. Commands listed in option ‘icicle-functions-to-redefine’ are typically, but not always, bound in keymaps other than the global map.

There are many Icicles commands that are not bound to any keys by default. You might want to bind some of them to keys in keymap ‘icicle-mode-map’, i.e., in Icicle mode. For a list of top-level Icicles commands, see the ‘Commentary’ headers of files icicles-cmd1.el and icicles-cmd2.el.

Minibuffer Bindings

There are many key bindings available while your input is read in the minibuffer, for example, while you are editing it. Some of these keys are available regardless of whether completion is available for your input.

Others are available only during completion. Most of those keys are bound in the minibuffer keymaps, but some are bound in the ‘*Completions*’ buffer keymap.

In addition, clicking ‘C-mouse-3’ on a completion candidate in buffer ‘*Completions*’ pops up a menu of available commands. Some of these menu commands are applicable to the completion you click; others apply to the current state of completion or to the complete set of completion candidates. The associated key bindings are indicated in the menu items, so this can be a good way to learn minibuffer and ‘*Completions*’ bindings.

You can easily customize the Icicles minibuffer and ‘*Completions*’ buffer key bindings. There are several user options available for this. This section describes the keys that are bound by default. Section Icicles - Customizing Key Bindings describes the options available for customizing them. The keys described in this section are those bound by default.

The following key is helpful during any minibuffer input. It pops up the ‘*Help*’ buffer with information about using the minibuffer in Icicle mode. During completion, this includes information similar to what you are reading now. It also lists toggle commands and the current toggle values.

The following key will always cancel all minibuffer input. No matter whether you have recursive minibuffers, it always returns you directly to the Emacs top level (“without passing GO”), but it first allows Icicles multi-commands to perform any necessary cleanup.

The following key performs Icicles key completion in the minibuffer.

You can also use this to see all of the keys that are currently available in the minibuffer, whether or not completion is available, and regardless of completion candidate type. ‘M-S-TAB’ does this by default, but you can change this by customizing option icicle-key-complete-keys-for-minibuffer.

The following key bindings are made for the minibuffer completion keymaps. They are in effect whenever you are using the minibuffer for input with completion (e.g. ‘completing-read’, ‘read-file-name’, ‘M-x’).

The keys mentioned are those that are bound by default and used in the documentation, but you can customize any or all of them using option icicle-completion-key-bindings.

Whether a modal cycling key is used for prefix or apropos completion at a given time depends on the current completion mode, which is determined by which of ‘TAB’ and ‘S-TAB’ was used last, or by option icicle-default-cycling-mode if neither was used.
(The mouse wheel bindings are only for Emacs 22 and later. The documentation refers to the keys that cycle completion candidates as ‘down’, ‘up’, ‘next’, ‘prior’, ‘end’, and ‘home’. Actually, these are the cycling keys only by default. You can customize the cycling keys using options icicle-modal-cycle-down-keys, icicle-modal-cycle-up-keys, icicle-apropos-cycle-next-keys, icicle-apropos-cycle-previous-keys, icicle-prefix-cycle-next-keys, icicle-prefix-cycle-previous-keys.)

By default, ‘TAB’ and ‘S-TAB’ also perform modal candidate cycling when you repeat them. You can inhibit this feature by customizing option icicle-TAB/S-TAB-only-completes-flag.

In Icicles, multi-line completion candidates are not uncommon. You can move up and down minibuffer lines with ‘C-p’ and ‘C-n’, and you can use the following keys to move among line beginnings and ends:

If you use libraries fit-frame.el and oneonone.el with a standalone minibuffer frame (non-‘nil’ ‘1on1-minibuffer-frame-flag’), and if option ‘1on1-fit-minibuffer-frame-flag’ is non-‘nil’, then the minibuffer frame is automatically resized to fit its content as you edit that content. (Options ‘1on1-fit-minibuffer-frame-max-height’ and ‘1on1-fit-minibuffer-frame-max-height-percent’ define the maximum height for this.)

If, in addition, you bind ‘1on1-fit-minibuffer-frame’ to a key, then you can use that key repeatedly to increase the height by one line, even beyond the maximum. Library setup-keys.el binds this to ‘C-o’.

(If you do not use a separate minibuffer frame, then you will likely want to set standard option ‘resize-mini-windows’ to ‘t’, not to ‘grow-only’, at least while in Icicle mode.)

You can insert a single Icicles multi-line dot using ‘C-u .’, or by turning on this dot magic generally, using ‘C-M-.’:

In vanilla Emacs, the following keys have a special purpose during input completion, but in Icicles they simply insert the character typed – they are self-inserting. This is because (1) there are better ways to do what vanilla Emacs uses these keys for and (2) it is useful to be able to insert these characters without first typing ‘C-q’ to quote them.

The only exception to this rule is that for ‘M-x’ (‘icicle-execute-extended-command’) with prefix completion, ‘SPC’ does the same thing as for vanilla Emacs: it completes the command name a word at a time.

The following minibuffer bindings are made to clear minibuffer input, making them handy for editing and removing completions (e.g. default or initial values) in the minibuffer.

‘M-k’ has an alternative behavior when you are cycling minibuffer history items: it deletes the current item from the history.

The following key is bound during completion to control the display of thumbnail images in ‘*Completions*’ for candidates that name image files or image-file bookmarks (see Bookmark+). It cycles the value of option icicle-image-files-in-Completions to show images and names (the default), show only names, or show only images.

During (absolute or relative) file-name completion, the following minibuffer bindings are also in effect:

During some absolute file-name completion, you can use ‘C-c C-d’ to change the current directory on the fly (think UNIX command ‘cd’). See also Absolute File Names and Different Directories.

During buffer-name completion, the following additional minibuffer bindings are defined by user option icicle-buffer-candidate-key-bindings. By default, they are the following:

The following minibuffer binding during completion refreshes the ‘*Completions*’ display.

You will likely never need to use it for that purpose. However, in Info mode, during command ‘icicle-Info-index’ (bound to ‘i’ in Info), the same key, ‘C-x C-M-l’, searches for all nodes that correspond to the current completion candidates, and highlights those that you have already visited, using face icicle-historical-candidate-other (which by default looks like a link).

The following minibuffer binding moves the cursor to the start of the part of your input, if any, that is highlighted because it does not match any completion candidate (see option icicle-highlight-input-completion-failure). Repeating this command kills the rest of the line, removing the highlighted mismatched input.

The remaining input matches at least one candidate.

The following minibuffer bindings can be used to get rid of a completion inserted during cycling, and retrieve what you last typed during completion or any previous completion inputs:

You can use these to cycle among and reuse inputs that you typed during completion but did not enter. This completion input is not recorded in the standard input histories – they record only input that you have entered with ‘RET’. See Icicles - History Enhancements.

For example, suppose that you used ‘C-h v hook’ to examine various hook variables, and you did this using‘C-next’ to display their documentation. If you finished the command by just typing ‘C-g’, then your input (‘hook’) was never really entered, so it is not available via the minibuffer history (‘M-p’). You can retrieve it with ‘C-l’, to use it again, in your next command. User option icicle-C-l-uses-completion-flag controls the behavior of ‘C-l’ and ‘C-L’; if non-‘nil’, then, instead of cycling inputs, these commands let you access previous inputs using completion.

You can insert minibuffer history items using the cycle keys ‘M-p’ and ‘M-n’, as usual. But in Icicle mode, ‘M-s’ and ‘M-r’ are not available. Instead, use ‘M-o’ to insert any history item using completion (including regexp completion, of course).

The following minibuffer bindings also let you use apropos completion on the current minibuffer history list. For explanation, see Icicles - History Enhancements.

Minibuffer binding ‘C-M-pause’ lets you use a different minibuffer history during the current input reading with completion. Normally, you are prompted for the history to use. Starting with Emacs 23, if option icicle-populate-interactive-history-flag is non-‘nil’, then during command, abbrev, and keyboard-macro completion, ‘C-M-pause’ completes your input against the history of all commands that were invoked interactively in any way, ‘icicle-interactive-history’.

The following minibuffer bindings let you act on candidate completions. For explanation, see Icicles - Multi-Commands, Icicles - More About Multi-Commands, and Icicles - Choose All Candidates, and Icicles - Object-Action Interaction.

(Some of these are only default key bindings. You can customize the keys to use for candidate actions, for instance. The mouse wheel bindings are only for Emacs 22 and later. The notation used here for the wheel bindings is that for Emacs on Windows; on other platforms different key notations are used for the wheel. This same note applies to corresponding keys used with modifiers ‘C-M-’ and ‘C-S-’ – see below.)

Except as noted, the bindings for ‘icicle-mouse-*’ are actually in the ‘*Completions*’ buffer.

The following minibuffer bindings provide help on candidate completions. For explanation, see Icicles - Help on Candidates and Icicles - Multi-Commands.

(Again, these are only default key bindings. See Icicles - Customizing Key Bindings.)

The following minibuffer bindings provide an alternative action for individual candidates. The alternative action is specific to the given command. Most commands define no alternative action.

The following minibuffer and ‘*Completions*’ buffer bindings let you perform set operations on sets of completion candidates. For explanation, see Icicles - Candidate Sets.

The following minibuffer bindings insert text in the minibuffer:

The following minibuffer bindings let you toggle Icicles options or cycle among alternative Icicles behaviors.

The following minibuffer bindings let you incrementally change options that affect the ‘*Completions*’ display columns and text size. To take advantage of these, you must also use DoReMi.

When used in the minibuffer, the following Icicles global binding lets you remove the ‘*Completions*’ window.

The following minibuffer bindings are in effect during Icicles search:

The following minibuffer binding lets you evaluate an EmacsLisp sexp at any time, using a recursive minibuffer. It displays the result of evaluation in the echo area or in a pop-up buffer, ‘*Pp Eval Output*’. With a prefix argument (‘C-u M-:’), it inserts the result into the minibuffer at point.

Some additional bindings are made available in the minibuffer for the duration of specific commands:

The following bindings are made for ‘completion-list-mode’, that is, for buffer ‘*Completions*’, which shows the list of candidate completions:


Previous: Icicles - File-Name Completion TipsIciclesIciclesIndexNext: Icicles - Customizing Key Bindings

DrewsElispLibraries referenced here: Lisp:icicles.el

CategoryKeys CategoryMenus CategoryCommands CategoryBufferSwitching CategoryCompletion CategoryRegexp CategoryDocumentation CategoryHelp CategoryRegion CategoryModes CategoryDirectories CategoryFiles CategoryProgrammerUtils CategoryCode