From 771cb159d960965603c6f0d44e34cb76f611d7d4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 11 Mar 2016 11:27:41 +0100 Subject: Emacs: Fix s-x map on OS X --- tag-emacs/emacs.d/init.org | 105 +++++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 52 deletions(-) (limited to 'tag-emacs/emacs.d') diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 280dfa3..8315769 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -325,6 +325,59 @@ modes. #+END_SRC +* Keybindings + +I think =set-keyboard-coding-system= stops OS X from doing something +annoying to add accents. The modifier setup is to match my +re-arrangement of modifiers on OSX: Cmd on the outside, then +Option/alt, then Control. + +#+BEGIN_SRC emacs-lisp + (when (eq system-type 'darwin) + (set-keyboard-coding-system nil) + (custom-set-variables + '(mac-option-modifier 'meta) + '(mac-right-option-modifier '(:function 'alt :mouse 'alt)) + '(mac-control-modifier 'control) + '(mac-right-control-modifier 'left) + '(mac-command-modifier 'super) + '(mac-right-command-modifier 'left) + '(mac-function-modifier 'hyper)) + (unbind-key "s-x")) +#+END_SRC + +#+BEGIN_SRC emacs-lisp + (unbind-key "") + (bind-key* "" #'compile) + (bind-key* "" #'kmacro-start-macro-or-insert-counter) + (bind-key* "" #'kmacro-end-or-call-macro) + + (bind-key* "" #'execute-extended-command) + + (unbind-key "C-z") + (bind-key* "C-" #'other-window) + + (bind-key* "C-x C-r" #'revert-buffer) + (bind-key* "C-x C-j" #'delete-indentation) + (unbind-key "C-x C-c") + + (bind-key* "C-c i" #'insert-char) + (bind-key* "M-/" #'hippie-expand) + + (unbind-key "s-h") + (unbind-key "s-n") + (unbind-key "s-p") + (unbind-key "s-w") + (bind-key* "s-k" #'kill-or-delete-this-buffer-dwim) + + (bind-key "C-M-a" #'backward-paragraph text-mode-map) + (bind-key "C-M-e" #'forward-paragraph text-mode-map) + + (bind-key* "s-x" (define-prefix-command 'super-x-map)) + (bind-key* "s-," #'switch-to-dotfiles) + (bind-key* "C-M-x" #'execute-extended-command) + (set-register ?z `(file . ,(expand-file-name ".config/zsh/zshrc" "~"))) +#+END_SRC * Projects #+BEGIN_SRC emacs-lisp @@ -1172,58 +1225,6 @@ rather useful. (setq eldoc-idle-delay 0.1) (eldoc-add-command 'paredit-backward-delete 'paredit-close-round))) #+END_SRC -* Keybindings - -I think =set-keyboard-coding-system= stops OS X from doing something -annoying to add accents. The modifier setup is to match my -re-arrangement of modifiers on OSX: Cmd on the outside, then -Option/alt, then Control. - -#+BEGIN_SRC emacs-lisp - (when (eq system-type 'darwin) - (set-keyboard-coding-system nil) - (custom-set-variables - '(mac-option-modifier 'meta) - '(mac-right-option-modifier '(:function 'alt :mouse 'alt)) - '(mac-control-modifier 'control) - '(mac-right-control-modifier 'left) - '(mac-command-modifier 'super) - '(mac-right-command-modifier 'left) - '(mac-function-modifier 'hyper))) -#+END_SRC - -#+BEGIN_SRC emacs-lisp - (unbind-key "") - (bind-key* "" #'compile) - (bind-key* "" #'kmacro-start-macro-or-insert-counter) - (bind-key* "" #'kmacro-end-or-call-macro) - - (bind-key* "" #'execute-extended-command) - - (unbind-key "C-z") - (bind-key* "C-" #'other-window) - - (bind-key* "C-x C-r" #'revert-buffer) - (bind-key* "C-x C-j" #'delete-indentation) - (unbind-key "C-x C-c") - - (bind-key* "C-c i" #'insert-char) - (bind-key* "M-/" #'hippie-expand) - - (unbind-key "s-h") - (unbind-key "s-n") - (unbind-key "s-p") - (unbind-key "s-w") - (bind-key* "s-k" #'kill-or-delete-this-buffer-dwim) - - (bind-key "C-M-a" #'backward-paragraph text-mode-map) - (bind-key "C-M-e" #'forward-paragraph text-mode-map) - - (bind-key* "s-x" (define-prefix-command 'super-x-map)) - (bind-key* "s-," #'switch-to-dotfiles) - (bind-key* "C-M-x" #'execute-extended-command) - (set-register ?z `(file . ,(expand-file-name ".config/zsh/zshrc" "~"))) -#+END_SRC * Misc #+BEGIN_SRC emacs-lisp -- cgit 1.4.1