0


I tried to set key bindings to ztree (dir and diff), but they are not working after the emacs startup (there is no errors). f8 and C-f8 works but not the navigation keys. Pleas help.

When I eval my init.el after starting ztree all keys are working correctly.
My init:

(use-package ztree
  :bind (("<f8>"   . ztree-dir)
         ("C-<f8>" . ztree-diff)
         :map ztree-mode-map
         ("n" . next-line)
         ("p" . previous-line)
         :map ztreedir-mode-map
         ("f" . ztree-dir-narrow-to-dir)
         ("b" . ztree-dir-widen-to-parent)))
0

I found the solution, now I use:

;; to bind keys to primary commands within ztree module
(use-package ztree
  :bind (("<f8>"   . ztree-dir)
         ("C-<f8>" . ztree-diff)))

;; to bind keys to local keymaps within ztree-dir
(use-package ztree-dir
  :bind (:map ztreedir-mode-map
              ("f" . ztree-dir-narrow-to-dir)
              ("b" . ztree-dir-widen-to-parent)))

;; to bind keys to local keymaps within ztree-dir and ztree-diff
(use-package ztree-view
  :bind (:map ztree-mode-map
              ("n" . next-line)
              ("p" . previous-line)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.