Skip to content

Instantly share code, notes, and snippets.

@guoc
Forked from railwaycat/mac-switch-meta.el
Created November 10, 2017 06:48
Show Gist options
  • Save guoc/874fcbc46746b6db6738d6e9acac8837 to your computer and use it in GitHub Desktop.
Save guoc/874fcbc46746b6db6738d6e9acac8837 to your computer and use it in GitHub Desktop.
meta key switch
;; Keybonds
(global-set-key [(hyper a)] 'mark-whole-buffer)
(global-set-key [(hyper v)] 'yank)
(global-set-key [(hyper c)] 'kill-ring-save)
(global-set-key [(hyper s)] 'save-buffer)
(global-set-key [(hyper l)] 'goto-line)
(global-set-key [(hyper w)]
(lambda () (interactive) (delete-window)))
(global-set-key [(hyper z)] 'undo)
;; mac switch meta key
(defun mac-switch-meta nil
"switch meta between Option and Command"
(interactive)
(if (eq mac-option-modifier nil)
(progn
(setq mac-option-modifier 'meta)
(setq mac-command-modifier 'hyper)
)
(progn
(setq mac-option-modifier nil)
(setq mac-command-modifier 'meta)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment