I would love to bind l and h (vim's left/right) to act as toggling directory open close, similar to treemacs-RET-action or treemacs-TAB-action. However, treemacs does not respect the following configuration code and defaults to its behavior:
(define-key treemacs-mode-map (kbd "l") 'treemacs-TAB-action)
(define-key treemacs-mode-map (kbd "h") treemacs-TAB-action)
Am I missing something, or is this potentially a bug?
Not a bug, just keymaps being complex, especially when evil is involved. Treemacs has its own evil state, so you should do something like this:
(evil-define-key 'treemacs treemacs-mode-map (kbd "h") #'treemacs-TAB-action)
Thanks @Alexander-Miller it works like a charm now! (Btw. great package! Enjoying a lot)
I'll close the issue.
I am having the same issue, but your binding does not do it for me.
I am using
(evil-define-key 'treemacs treemacs-mode-map (kbd "h") #'treemacs-TAB-action)
, but when I use describe-key for h and l emacs tells me they are still bound to evil-backward-char and evil-forward-char. Do you have any further suggestions?
@ludvikn h should be bound to treemacs-root-up. Is treemacs-evil installed and loaded properly?
Most helpful comment
@ludvikn
hshould be bound totreemacs-root-up. Istreemacs-evilinstalled and loaded properly?