How do I override treemacs-RET-action to run my custom command?

When I press the RET key or double click with mouse, I want to run a command instead of what it does now.

I tried this:

(after! treemacs
  (define-key evil-treemacs-state-map (kbd "RET") #'custom/treemacs-open-file))

While in tremacs and I do M-x, I can even see that RET is linked to my custom command, but it still does not run my custom command.

This topic was automatically closed after 360 days. New replies are no longer allowed.