Open et2010 opened 6 years ago
AFAIK, actions are currently designed to be "global", so there is no "built-in" way to predicate them on the current major-mode
. Nevertheless, there are various hacks you could try until such conditionality is added:
(when (derived-mode-p 'org-mode) ...)
at the top-level of et/counsel-insert-org-link
, or make the action a no-op that doesn't exit completion unless the buffer is in org-mode
.ivy-read-action-format-function
to a custom function which only mentions the desired actions.counsel-find-file
to dynamically modify its actions based on the current major-mode
.ivy-read-action
.
For example, I use these command to add org links into an org buffer. But they are of no use when in other modes. How could I add actions only visible when current buffer is an orgmode buffer?