Last edit
Ändrad:
< See [[Icicles - Key Bindings]] for a description of the [[key binding]]s
till
> See [[Icicles - Key Bindings]] for a description of the default [[key binding]]s
Ändrad:
< there, in context. You can [[Customize|customize]] all of the key-binding user options with `M-x customize-group RET Icicles-Key-Bindings'.
till
> there, in context. You can [[Customize|customize]] all of the key-binding user options (there are over 50 of them!) using this command:
> M-x customize-group RET Icicles-Key-Bindings
Ändrad:
< The main user option for customizing key bindings is
< '''`<tt>[[Icicles - Customization and General Tips#icicle-top-level-key-bindings|icicle-top-level-key-bindings]]</tt>''''. You use it to change or remove
< any of the top-level bindings in ''Icicle'' mode.
< There are some other user options that make it easy to customize
< '''Icicles''' key bindings. Most of these are [[minibuffer]]
< bindings.
< The most general option for customizing minibuffer bindings is
< '''`<tt>[[Icicles - Customization and General Tips#icicle-completion-key-bindings|icicle-completion-key-bindings]]</tt>''''. It covers everything that is
< not covered by the other minibuffer key options listed below, which are concerned with [[completion]], [[Icicles - Cycling Completions|cycling]], and help. Option
< `icicle-completion-key-bindings' has the same form as option
< `icicle-top-level-key-bindings'.
till
> * `*Completions*' buffer bindings
> The '''Icicles''' [[user option]]s for binding keys take two forms. In most
> cases, the option name ends with `-keys', and the option value is
> simply a list of keys that act the same.
> In the following cases, however, the option name ends with
> '''`-key-bindings'''' and the option value is a list of possibly
> conditional key bindings.
> * '''`<tt>[[Icicles - Customization and General Tips#icicle-top-level-key-bindings|icicle-top-level-key-bindings]]</tt>'''' -- ''top-level'' key bindings.
> * '''`<tt>[[Icicles - Customization and General Tips#icicle-minibuffer-key-bindings|icicle-minibuffer-key-bindings]]</tt>'''' -- [[minibuffer]] key bindings
> defined regardless of whether completion is available. This
> does not include keys concerned with completion, cycling, and
> help, which are covered by other options (below).
> * '''`<tt>[[Icicles - Customization and General Tips#icicle-completion-key-bindings|icicle-completion-key-bindings]]</tt>'''' -- minibuffer key bindings
> available during [[completion]].
> * '''`<tt>[[Icicles - Customization and General Tips#icicle-completion-list-key-bindings|icicle-completion-list-key-bindings]]</tt>'''' -- key bindings for buffer `*Completions*'.
> Each of these `*-key-bindings' options has the same form, a list
> of elements which each have the form ##(KEY COMMAND CONDITION)##. ##KEY##
> is either a key sequence (string or vector) to bind ##COMMAND## to or
> a command to remap to ##COMMAND##. ##COMMAND## is bound according to the
> value of ##KEY##, unless the result of evaluating ##CONDITION## is `nil'.
> The following options, with names ending in '''`-keys'''', cover keys
> available during completion and which provide [[completion]], [[Icicles - Cycling Completions|cycling]],
> or help.
Deleted:
< [:icicle-key-complete-keys]
< [:icicle-previous-candidate-keys]
< [:icicle-completing-read+insert-keys]
< [:icicle-read+insert-file-name-keys]
< [:icicle-search-from-isearch-keys]
< [:icicle-isearch-complete-keys]
Tillagd:
> [:icicle-key-complete-keys]
> [:icicle-completing-read+insert-keys]
> [:icicle-read+insert-file-name-keys]
> [:icicle-search-from-isearch-keys]
> [:icicle-isearch-complete-keys]
> The following options, with names ending in '''`-keys'''', cover
> miscellaneous actions that make use of the minibuffer in some way.
Deleted:
< * '''`<tt>[[Icicles - Customization and General Tips#icicle-previous-candidate-keys|icicle-previous-candidate-keys]]</tt>'''' ('''`S-TAB'''') Move to the previous candidate in `*Completions*'.
Ändrad:
< * '''`<tt>[[Icicles - Customization and General Tips#icicle-isearch-complete-keys|icicle-isearch-complete-keys]]</tt>'''' ('''`M-TAB'''', '''`C-M-TAB'''', '''`M-o'''')
till
> * '''`<tt>[[Icicles - Customization and General Tips#icicle-isearch-complete-keys|icicle-isearch-complete-keys]]</tt>'''' ('''`M-TAB'''', '''`C-M-TAB'''')
Tillagd:
> * '''`<tt>[[Icicles - Customization and General Tips#icicle-isearch-history-insert-keys|icicle-isearch-history-insert-keys]]</tt>'''' ('''`M-o'''')
> Append past Isearch strings, using completion with the search ring.
| Previous: Icicles - Key Bindings | Icicles | IciclesIndex | Next: Icicles - Standard Functions Redefined |
See Icicles - Key Bindings for a description of the default key bindings defined by Icicles. The user options mentioned here are also presented there, in context. You can customize all of the key-binding user options (there are over 50 of them!) using this command:
M-x customize-group RET Icicles-Key-Bindings
Key bindings are very personal choices, and reflect preferences and habits, as well as keyboard and other configurations. You might want to change some of the bindings that Icicles creates. This page tells you how to do that.
However, before doing so, unless the default bindings present a hardware or OS configuration problem for you, please try using the default Icicles bindings for a while, before deciding that you want to change them. Habit is a powerful persuader, but its advice is not always the best ;-).
These are the main kinds of Icicles key bindings. They are described in the sections below.
‘S-TAB’ by default)‘*Completions*’ buffer bindingsThe Icicles user options for binding keys take two forms. In most cases, the option name ends with ‘-keys’, and the option value is simply a list of keys that act the same.
In the following cases, however, the option name ends with ‘-key-bindings’ and the option value is a list of possibly conditional key bindings.
‘*Completions*’.Each of these ‘*-key-bindings’ options has the same form, a list of elements which each have the form (KEY COMMAND CONDITION). KEY is either a key sequence (string or vector) to bind COMMAND to or a command to remap to COMMAND. COMMAND is bound according to the value of KEY, unless the result of evaluating CONDITION is ‘nil’.
The following options, with names ending in ‘-keys’, cover keys available during completion and which provide completion, cycling, or help.
‘down’, ‘wheel-down’). Cycle to the next candidate (modal).‘up’, ‘wheel-up’). Cycle to the previous candidate (modal).‘next’). Cycle to the next apropos-completion candidate.‘prior’). Cycle to the previous apropos completion candidate.‘end’) Cycle to the next prefix-completion candidate.‘home’). Cycle to the previous prefix completion candidate.‘C-RET’). Act on the current completion candidate.‘C-down’, ‘C-wheel-down’). Cycle to the next candidate and act on it (modal).‘C-up’, ‘C-wheel-up’). Cycle to the previous candidate and act on it (modal).‘C-next’). Cycle to the next apropos-completion candidate and act on it.‘C-prior’). Cycle to the previous apropos completion candidate and act on it.‘C-end’). Cycle to the next prefix-completion candidate and act on it.‘C-home’). Cycle to the previous prefix completion candidate and act on it.‘C-S-down’, ‘C-S-wheel-down’). Cycle to the next candidate and alternative-act on it (modal).‘C-S-up’, ‘C-S-wheel-down’). Cycle to the previous candidate and alternative-act on it (modal).‘C-S-next’). Cycle to the next apropos-completion candidate and alternative-act on it.‘C-S-prior’). Cycle to the previous apropos completion candidate and alternative-act on it.‘C-S-end’). Cycle to the next prefix-completion candidate and alternative-act on it.‘C-S-home’). Cycle to the previous prefix completion candidate and alternative-act on it.‘C-M-RET’ etc.). Display help for the current completion candidate.‘C-M-down’, ‘C-M-wheel-down’). Cycle to the next candidate and show help for it (modal).‘C-M-up’, ‘C-M-wheel-up’). Cycle to the previous candidate and show help for it (modal).‘C-M-next’). Cycle to the next apropos-completion candidate and show help for it.‘C-M-prior’). Cycle to the previous apropos completion candidate and show help for it.‘C-M-end’). Cycle to the next prefix-completion candidate and show help for it.‘C-M-home’). Cycle to the previous prefix completion candidate and show help for it.‘TAB’) Prefix-complete your input.‘S-TAB’) Apropos-complete your input.‘C-M-TAB’) Prefix-complete without showing ‘*Completions*’.‘C-M-S-TAB’) Apropos-complete without showing ‘*Completions*’.‘M-SPC’) Prefix-complete your input a word at a time. The following options, with names ending in ‘-keys’, cover miscellaneous actions that make use of the minibuffer in some way.
‘S-TAB’) Complete key sequences.‘C-M-S-c’) Completion on demand.‘C-M-S-f’) Completion on demand for file names.‘S-TAB’) Start ‘icicle-search’ from Isearch.‘M-TAB’, ‘C-M-TAB’) Complete Isearch string using search ring.‘M-o’) Append past Isearch strings, using completion with the search ring. Whenever you customize an Icicles key binding, whether via a user option value or using ‘define-key’ or ‘global-set-key’, you can use function ‘icicle-kbd’ to express the key sequence in a user-friendly way. It is the same as vanilla Emacs ‘kbd’, except that (by default) it does not require you to use angle brackets (`<’, `>’) around function keys (and it does not expect you to).
So you can write, e.g., (icicle-kbd "C-delete") instead of one of these: (kbd "C-<delete>"), [C-delete], or [(control delete)]. There are plenty of examples of the use of ‘icicle-kbd’ in the Icicles source files.
In addition to the options listed above, whose values are keys or lists of keys, option ‘icicle-TAB/S-TAB-only-completes-flag’ controls whether repeating ‘TAB’ or ‘S-TAB’ causes (modal) candidate cycling. The default value of ‘nil’ means that it does. If you prefer that these keys (actually the keys that are the values of options `icicle-prefix-complete-keys’ and `icicle-apropos-complete-keys’) perform only completion and you use other keys for cycling, then set the value to non-‘nil’.
Icicles normally adds items to appropriate existing menu-bar menus, such as File and Options, as well as to menu-bar menus Minibuf and Icicles. These items are placed in an Icicles submenu (e.g. Files > Icicles). If you do not want to add an Icicles submenu, then set option `icicle-touche-pas-aux-menus’ to non-‘nil’ before loading Icicles. The menu items are then added to the Icicles menu instead.
Icicles binds key completion (‘icicle-complete-keys’) to the keys defined in option `icicle-key-complete-keys’. See Icicles - Key Bindings for more information about this.
In the Icicle mode keymap, several top-level commands are bound by default. You can use option `icicle-top-level-key-bindings’ to customize the keys that are used for these commands, or to remove any such bindings.
There are user options for most Icicles minibuffer bindings that you might want to change – see above for the list. This section tells you how to change additional bindings.
To understand how you can modify Icicles minibuffer bindings, it helps to know how Icicles creates the default bindings. For that, the best advice is to consult the EmacsLisp code in library icicles-mode.el. Even if you are not very familiar with Emacs-Lisp, however, you should be able to do what you want by adapting the example shown here.
Suppose that you want to bind ‘f11’ and ‘f12’ to traverse the input history up and down whenever you are in Icicle mode. There are no user options for this, but you can do it by inserting this code into your init file (~/.emacs), before the code that requires (loads) library icicles.el:
(add-hook 'icicle-mode-hook 'bind-my-icicles-keys)
(defun bind-my-icicles-keys ()
"Replace some default Icicles minibuffer bindings with others."
(dolist (map (append (list minibuffer-local-completion-map
minibuffer-local-must-match-map)
(and (fboundp 'minibuffer-local-filename-completion-map)
(list minibuffer-local-filename-completion-map))))
(when icicle-mode
(define-key map (icicle-kbd "f11") 'previous-history-element)
(define-key map (icicle-kbd "f12") 'next-history-element))))Icicles does not change the standard Emacs minibuffer bindings for ‘M-p’ and ‘M-n’, so they are still ‘previous-history-element’ and ‘next-history-element’. You can just use ‘define-key’ to change the bindings of ‘M-p’ and ‘M-n’.
See also:
| Previous: Icicles - Key Bindings | Icicles | IciclesIndex | Next: Icicles - Standard Functions Redefined |
DrewsElispLibraries referenced here: Lisp:icicles.el, Lisp:icicles-fn.el
CategoryKeys CategoryMenus CategoryCommands CategoryCompletion CategoryModes CategoryCode