Node:Personal keybindings, Previous:Incremental search, Up:Using the keyboard
There are five hooks which can be used for adding personal keybindings to the ECB tree-buffers:
ecb-common-tree-buffer-after-create-hook
ecb-directories-buffer-after-create-hook
ecb-sources-buffer-after-create-hook
ecb-methods-buffer-after-create-hook
ecb-history-buffer-after-create-hook
These hooks are called directly after tree-buffer creation so they can
be used to add personal local keybindings1 either to all tree-buffers
(ecb-common-tree-buffer-after-create-hook
) or just to a certain
tree-buffer. Here is a list which keys MUST NOT be rebound:
ecb-toggle-RET-selects-edit-window
.
The following example binds C-a to some useful code in ALL
tree-buffers and C-d to even more useful code ONLY in the
directories buffer:
(add-hook 'ecb-common-tree-buffer-after-create-hook (lambda () (local-set-key (kbd "C-a") (lambda () (interactive) (message "ECB is great!"))))) (add-hook 'ecb-directories-buffer-after-create-hook (lambda () (local-set-key (kbd "C-d") (lambda () (interactive) (message "ECB is wonderful!")))))