0

What is the proper way to bind S-; to execute-extended-command?

I tried this (bind-key* "S-;" 'execute-extended-command) but doesn't work. bind-key is a function from use-package.

Update

I use evil mode.

3
  • Are you able to type Shift+:? Most keyboards require pressing shift just to enter a :.
    – npostavs
    May 5, 2016 at 15:19
  • @npostavs thanx for pointing out. I have updated the question
    – user24665
    May 5, 2016 at 15:30
  • 4
    Ah, I don't think you can type S-; from Emacs' point of either, you probably just want to bind :.
    – npostavs
    May 5, 2016 at 15:35

1 Answer 1

2

To figure out how to define a key binding that emacs can understand, simply do C-h c or C-h k following by pressing the keys you intend to bind.

In this case, doing C-h c followed by Shift+; gives :. So you need to bind the command to :.

So taking your example, it should be,

(bind-key* ":" #'execute-extended-command)

Your Answer

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

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