In my Emacs (spacemacs) setup, with org-mode
, I like to use both company-mode
and org-cdlatex-mode
.
I like company-mode
to provide autocompletion most of the time, but I'd like to have cdlatex's auto-completion triggered by TAB
first, only if cdlatex's autocompletion finds no completion, then the company's autocompletion should be used.
What would be the best solution?
- I figure that I could somehow arrange the priority in processing the key event of
TAB
, letting cdlatex have the priority. (But how?) - Or, write my own
TAB
event dispatcher: first callorg-try-cdlatex-tab
, only if it return false, then call company-mode's function forTAB
event processing. (This would be very customized, will be complicated to maintain.) - Or, use a different key for cdlatex autocompletion (This is quite doable, but requires additional human memory.)