Emacs on Mac OS X Leopard key bindings

后端 未结 13 1275
予麋鹿
予麋鹿 2020-11-28 00:21

I\'m a Mac user and I\'ve decided to learn Emacs. I\'ve read that to reduce hand strain and improve accuracy the CTRL and CAPS LOCK keys should be swap

13条回答
  •  生来不讨喜
    2020-11-28 00:57

    This thread was started 5 years ago and there is no mention of ns-win.el or build --with-ns. Here are all the key bindings available (out of the box) in Emacs Trunk as of October 2013. And, of course, you can create your own. Personally, I have one init.el with all my key bindings that can be used with Windows XP through Parallels on OSX, and also with OSX natively. Since the user can define his / her own keyboard shortcuts, I do not see a need to remap the keyboard in system preferences (with an Apple U.S. keyboard) unless using a keyboard that does not include the Command key. But, would I throw away my stash of IBM clicky keyboards with trackpoint built in? Of course not. :) I'm taking my IBM clicky keyboards with me into the next life. Any hand strain is most likely caused by improper wrist / arm / elbow position, not by hitting control versus caps lock. Accuracy is improved through practice, and with the help of a boss looking over your shoulder to see how you are coming along -- i.e., a little pressure to be more productive :)

    (define-key global-map [?\s-,] 'customize)
    (define-key global-map [?\s-'] 'next-multiframe-window)
    (define-key global-map [?\s-`] 'other-frame)
    (define-key global-map [?\s-~] 'ns-prev-frame)
    (define-key global-map [?\s--] 'center-line)
    (define-key global-map [?\s-:] 'ispell)
    (define-key global-map [?\s-?] 'info)
    (define-key global-map [?\s-^] 'kill-some-buffers)
    (define-key global-map [?\s-&] 'kill-this-buffer)
    (define-key global-map [?\s-C] 'ns-popup-color-panel)
    (define-key global-map [?\s-D] 'dired)
    (define-key global-map [?\s-E] 'edit-abbrevs)
    (define-key global-map [?\s-L] 'shell-command)
    (define-key global-map [?\s-M] 'manual-entry)
    (define-key global-map [?\s-S] 'ns-write-file-using-panel)
    (define-key global-map [?\s-a] 'mark-whole-buffer)
    (define-key global-map [?\s-c] 'ns-copy-including-secondary)
    (define-key global-map [?\s-d] 'isearch-repeat-backward)
    (define-key global-map [?\s-e] 'isearch-yank-kill)
    (define-key global-map [?\s-f] 'isearch-forward)
    (define-key global-map [?\s-g] 'isearch-repeat-forward)
    (define-key global-map [?\s-h] 'ns-do-hide-emacs)
    (define-key global-map [?\s-H] 'ns-do-hide-others)
    (define-key global-map [?\s-j] 'exchange-point-and-mark)
    (define-key global-map [?\s-k] 'kill-this-buffer)
    (define-key global-map [?\s-l] 'goto-line)
    (define-key global-map [?\s-m] 'iconify-frame)
    (define-key global-map [?\s-n] 'make-frame)
    (define-key global-map [?\s-o] 'ns-open-file-using-panel)
    (define-key global-map [?\s-p] 'ns-print-buffer)
    (define-key global-map [?\s-q] 'save-buffers-kill-emacs)
    (define-key global-map [?\s-s] 'save-buffer)
    (define-key global-map [?\s-t] 'ns-popup-font-panel)
    (define-key global-map [?\s-u] 'revert-buffer)
    (define-key global-map [?\s-v] 'yank)
    (define-key global-map [?\s-w] 'delete-frame)
    (define-key global-map [?\s-x] 'kill-region)
    (define-key global-map [?\s-y] 'ns-paste-secondary)
    (define-key global-map [?\s-z] 'undo)
    (define-key global-map [?\s-|] 'shell-command-on-region)
    (define-key global-map [s-kp-bar] 'shell-command-on-region)
    ;; (as in Terminal.app)
    (define-key global-map [s-right] 'ns-next-frame)
    (define-key global-map [s-left] 'ns-prev-frame)
    
    (define-key global-map [home] 'beginning-of-buffer)
    (define-key global-map [end] 'end-of-buffer)
    (define-key global-map [kp-home] 'beginning-of-buffer)
    (define-key global-map [kp-end] 'end-of-buffer)
    (define-key global-map [kp-prior] 'scroll-down-command)
    (define-key global-map [kp-next] 'scroll-up-command)
    
    ;; Allow shift-clicks to work similarly to under Nextstep.
    (define-key global-map [S-mouse-1] 'mouse-save-then-kill)
    (global-unset-key [S-down-mouse-1])
    

提交回复
热议问题