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 "`")))
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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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