2

我正在Emacs使用OS Xfrom 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"但这对我不起作用。所以,这里有两个问题:

更新

  1. 如何创建映射⌥</kbd> Option key?
(setq mac-option-modifier 'hyper)
;; now you can easily use mappings with Hyper key modifier
  1. 如何创建到箭头键的映射?
(define-key evil-insert-state-map (kbd "<H-left>") 'left-word)
;; defines Hyper+left arrow combination
4

1 回答 1

2

我没有mac。您能否尝试按照页面底部的说明进行操作http://ergoemacs.org/emacs/emacs_hyper_super_keys.html

您可以C-h c通过键入它来描述键绑定,它还返回您必须作为参数提供给的字符串kbd

于 2015-02-05T16:09:00.787 回答