Next: Using popup-menus, Previous: Incremental search, Up: Using the keyboard [Contents][Index]
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 keybindings17 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-do-not-leave-window-after-select
.
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!")))))
To be more general: They can be used to run any arbitrary lisp code after a tree-buffer creation!