diff --git a/core/core-os.el b/core/core-os.el index 6a45a20d6..4ca91a5d8 100644 --- a/core/core-os.el +++ b/core/core-os.el @@ -20,13 +20,9 @@ (when (featurep 'exec-path-from-shell) `(exec-path-from-shell-copy-envs ,@vars))) -;; key conventions: -;; alt/option = meta -;; windows/command = super - (cond (IS-MAC - (setq mac-command-modifier 'super - mac-option-modifier 'meta + (setq mac-command-modifier 'meta + mac-option-modifier 'alt ;; sane trackpad/mouse scroll settings mac-redisplay-dont-reset-vscroll t mac-mouse-wheel-smooth-scroll nil @@ -68,12 +64,7 @@ x-underline-at-descent-line t)) ; draw underline lower (IS-WINDOWS - (setq w32-get-true-file-attributes nil ; fix file io slowdowns - ;; map window keys to super (unreliable) - w32-pass-lwindow-to-system nil - w32-pass-rwindow-to-system nil - w32-lwindow-modifier 'super - w32-rwindow-modifier 'super) + (setq w32-get-true-file-attributes nil) ; fix file io slowdowns (when (display-graphic-p) (setenv "GIT_ASKPASS" "git-gui--askpass")))) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index c099cab22..d53d50aa3 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -17,11 +17,9 @@ ;; Global keybindings (map! (:map override - ;; Make M-x more accessible - "s-x" 'execute-extended-command - "M-x" 'execute-extended-command ;; A little sandbox to run code in - "s-;" 'eval-expression) + "A-;" 'eval-expression + "M-;" 'eval-expression) [remap evil-jump-to-tag] #'projectile-find-tag [remap find-tag] #'projectile-find-tag @@ -68,7 +66,7 @@ :m "B" #'realgud:cmd-clear) (:when (featurep! :feature eval) - :g "s-r" #'+eval/buffer + :g "M-r" #'+eval/buffer :nv "gr" #'+eval:region :n "gR" #'+eval/buffer :v "gR" #'+eval:replace-region) @@ -189,9 +187,9 @@ (:map yas-keymap "C-e" #'+snippets/goto-end-of-field "C-a" #'+snippets/goto-start-of-field - [s-right] #'+snippets/goto-end-of-field - [s-left] #'+snippets/goto-start-of-field - [s-backspace] #'+snippets/delete-to-start-of-field + [M-right] #'+snippets/goto-end-of-field + [M-left] #'+snippets/goto-start-of-field + [M-backspace] #'+snippets/delete-to-start-of-field [backspace] #'+snippets/delete-backward-char [delete] #'+snippets/delete-forward-char-or-field) (:map yas-minor-mode-map @@ -219,7 +217,17 @@ :n "gt" #'+workspace/switch-right :n "gT" #'+workspace/switch-left :n "]w" #'+workspace/switch-right - :n "[w" #'+workspace/switch-left)) + :n "[w" #'+workspace/switch-left + :g "M-1" (λ! (+workspace/switch-to 0)) + :g "M-2" (λ! (+workspace/switch-to 1)) + :g "M-3" (λ! (+workspace/switch-to 2)) + :g "M-4" (λ! (+workspace/switch-to 3)) + :g "M-5" (λ! (+workspace/switch-to 4)) + :g "M-6" (λ! (+workspace/switch-to 5)) + :g "M-7" (λ! (+workspace/switch-to 6)) + :g "M-8" (λ! (+workspace/switch-to 7)) + :g "M-9" (λ! (+workspace/switch-to 8)) + :g "M-0" #'+workspace/switch-to-last)) ;;; :completion (map! (:when (featurep! :completion company) @@ -448,9 +456,7 @@ :after markdown-mode :map markdown-mode-map ;; fix conflicts with private bindings - "" nil - "" nil - "" nil)) + [backspace] nil)) ;; diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 85f35fc7f..835cf66e4 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -127,35 +127,8 @@ (when IS-MAC ;; Fix MacOS shift+tab (define-key input-decode-map [S-iso-lefttab] [backtab]) - - (define-key! - ;; Buffer-local font scaling - "s-+" (λ! (text-scale-set 0)) - "s-=" #'text-scale-increase - "s--" #'text-scale-decrease - ;; Fix frame-switching on MacOS - "s-`" #'other-frame - ;; Simple window/frame navigation/manipulation - "s-w" #'delete-window - "s-W" #'delete-frame - "s-n" #'+default/new-buffer - "s-N" #'make-frame - ;; Textmate-esque bindings - "s-a" #'mark-whole-buffer - "s-b" #'+default/compile - "s-f" #'swiper - "s-q" (if (daemonp) #'delete-frame #'evil-quit-all) - ;; Restore OS undo, save, copy, & paste keys (without cua-mode, because - ;; it imposes some other functionality and overhead we don't need) - "s-z" #'undo - "s-s" #'save-buffer - "s-c" (if (featurep 'evil) 'evil-yank 'copy-region-as-kill) - "s-v" #'yank - ;; textmate-esque newline insertion - [s-return] #'evil-open-below - [S-s-return] #'evil-open-above - ;; textmate-esque deletion - [s-backspace] #'doom/backward-kill-to-bol-and-indent)) + ;; Fix frame-switching key on MacOS + (global-set-key (kbd "M-`") #'other-frame)) ;; @@ -166,6 +139,38 @@ (map! "C-b" #'backward-word "C-f" #'forward-word) + ;; Make M-x more accessible + (define-key! 'override + "M-x" #'execute-extended-command + "A-x" #'execute-extended-command) + + (define-key! + ;; Buffer-local font scaling + "M-+" (λ! (text-scale-set 0)) + "M-=" #'text-scale-increase + "M--" #'text-scale-decrease + ;; Simple window/frame navigation/manipulation + "M-w" #'delete-window + "M-W" #'delete-frame + "M-n" #'+default/new-buffer + "M-N" #'make-frame + ;; Restore OS undo, save, copy, & paste keys (without cua-mode, because + ;; it imposes some other functionality and overhead we don't need) + "M-z" #'undo + "M-s" #'save-buffer + "M-c" (if (featurep 'evil) 'evil-yank 'copy-region-as-kill) + "M-v" #'yank + ;; Textmate-esque bindings + "M-a" #'mark-whole-buffer + "M-b" #'+default/compile + "M-f" #'swiper + "M-q" (if (daemonp) #'delete-frame #'evil-quit-all) + ;; textmate-esque newline insertion + [M-return] #'evil-open-below + [M-S-return] #'evil-open-above + ;; textmate-esque deletion + [M-backspace] #'doom/backward-kill-to-bol-and-indent) + (if (featurep 'evil) (load! "+evil-bindings") (load! "+emacs-bindings")))