我正在Emacs
使用OS X
from mac ports
。默认情况下,我有Ctrl作为Control
键,并且⌘</kbd> 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. ⌘</kbd>+←</kbd> to move one word forward. What I realy want to have:
- ⌥</kbd>+←</kbd> move 1 word backward
- ⌥</kbd>+→</kbd> move 1 word forward
- ⌘</kbd>+←</kbd> move to 1st non-whitespace charachter of the line
- ⌘</kbd>+→</kbd> move to the line end
- 而在所有其他情况下⌘</kbd> ≡ Meta
我尝试在我的映射中使用(kbd "A-left")
,"\A-left"
但这对我不起作用。所以,这里有两个问题:
更新
- 如何创建映射⌥</kbd>
Option
key?
(setq mac-option-modifier 'hyper)
;; now you can easily use mappings with Hyper key modifier
- 如何创建到箭头键的映射?
(define-key evil-insert-state-map (kbd "<H-left>") 'left-word)
;; defines Hyper+left arrow combination