0

How would you bind the useless œ (or 2-square) key from azerty keywords to enter ` (backtick, backquote, or however you want to call the symbol needed for code blocks in markdown) ?

My problems are :

  • I am not sure know how to express this key as a (kbd ...) form
  • I don't know how to express "insert this char".

This does NOT work :

(global-set-key (kbd "œ") (lambda () (insert "`")))
(global-set-key (kbd "œ") '(lambda () (insert "`")))
(global-set-key (kbd "œ") '(insert "`")))

1 Answer 1

0

You can find out which key Emacs thinks œ is by hitting C-h k œ.

When you want a key simply to enter a string, you can just tell it to do so without invoking a function. Hence, this binding should work, assuming the "œ" part is correct:

(global-set-key "œ" "`")

You may have to replace the "œ" part with whatever Emacs thinks that key is.

1
  • Ok. My problem was that for some reason, smart-parens would not let me type the last part of this.
    – phtrivier
    Mar 16, 2017 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.