How do I resolve keybinding conflict? Or if it's possible to have precedence of keybindings for the same key for different functions?
I have the following snippet definition, in org-mode:
#+name:${2:name}
#+begin_src ${1:lang}
$0 $2
#+end_src
It expands to the following:
#+name:name
#+begin_src lang
name
#+end_src
text-wise, it looks correct. But after the expansion, the fields of variable substitution are not highlighted for substitution. I cannot use TAB
to update the name and lang, instead TAB
would fold the expanded snippet as shown below:
#+name:name
#+begin_src lang...
It triggers function org-cycle
as the cursor is just on the line of #+name:
Would it be possible to let the keybindings of TAB
for snippet field substitution
have higher precedence over org-cycle
, so that when it's possible for snippet field substitution
, then TAB
will do the snippet field substitution
, otherwise the ordinary org-cycle
in this case?
I also welcome any other solution to make this snippet work in org-mode.
snippet field substitution
? (What is the command? Which library provides it?)snippet field substitution
. I mean the function that is supposed to be triggered by the 2nd key pressTAB
, when the first key pressTAB
to trigger snippet expansion. The 2nd is supposed to trigger the field substitution.C-h k TAB
to learn which command is bound toTAB
.