2

I'm using Emacs on OS X from mac ports. By default I have Ctrl as Control key, and Command as Meta key. Thogh, this is quite handy, I'm missing possibility to move cursor one word backward/forward by pressing M-arrrow key, i.e. + to move one word forward. What I realy want to have:

  • + move 1 word backward
  • + move 1 word forward
  • + move to 1st non-whitespace charachter of the line
  • + move to the line end
  • while in all other cases Meta

I tryed to use in my mappings (kbd "A-left"), "\A-left", but this does not worked for me. So, two questions here:

UPDATED

  1. how to create mapping for Option key?
(setq mac-option-modifier 'hyper)
;; now you can easily use mappings with Hyper key modifier
  1. how to cerate mapping to arrow keys?
(define-key evil-insert-state-map (kbd "<H-left>") 'left-word)
;; defines Hyper+left arrow combination
Geradlus_RU
  • 1,466
  • 2
  • 20
  • 37

1 Answers1

2

I do not have a mac. Could you try following the instructions at the bottom of the page http://ergoemacs.org/emacs/emacs_hyper_super_keys.html

You can use C-h c to describe a keybinding by typing it which also returns the string that you have to give as a parameter to kbd.

homeless
  • 336
  • 1
  • 8
  • Super duper! I've mapped my `⌥ Option` key to `Hyper`, after that it's very easy to define keys I want. ``` (setq mac-option-modifier 'hyper) (define-key evil-insert-state-map (kbd "") 'left-word) ``` – Geradlus_RU Feb 05 '15 at 19:50
  • the trickiest thing I had to do is to find out right syntax to describe exact combination, e.g. ``, `H-left` does not worked for me. – Geradlus_RU Feb 05 '15 at 19:53
  • I' a lier. Actually, this `` does work , while `` does not! – Geradlus_RU Feb 05 '15 at 20:09