diff --git a/.emacs.d/include/priime-general.el b/.emacs.d/include/priime-general.el index 89a7622..6d17685 100644 --- a/.emacs.d/include/priime-general.el +++ b/.emacs.d/include/priime-general.el @@ -185,7 +185,6 @@ (global-so-long-mode 1) (rassq-delete-all 'auto-save-mode auto-mode-alist) - (windmove-default-keybindings) (put 'scroll-left 'disabled nil) (put 'scroll-right 'disabled nil) diff --git a/.emacs.d/include/priime-ui.el b/.emacs.d/include/priime-ui.el index bae9730..3ce48a0 100644 --- a/.emacs.d/include/priime-ui.el +++ b/.emacs.d/include/priime-ui.el @@ -6,6 +6,8 @@ (require 'projectile) (require 'magit) +;;; Neotree + (defun neotree-toggle-dir-or-project () "By default, toggle the directory at the project level, with prefix current." (interactive) @@ -37,12 +39,47 @@ (neotree-hide) (neotree-dir dir))) +;;; Windmove +(defun priime-window-left () + "Move or swap with the left window." + (interactive) + (if (eq current-prefix-arg nil) + (windmove-left) + (windmove-swap-states-left))) + +(defun priime-window-right () + "Move or swap with the right window." + (interactive) + (if (eq current-prefix-arg nil) + (windmove-right) + (windmove-swap-states-right))) + +(defun priime-window-down () + "Move or swap with the down window." + (interactive) + (if (eq current-prefix-arg nil) + (windmove-down) + (windmove-swap-states-down))) + +(defun priime-window-up () + "Move or swap with the up window." + (interactive) + (if (eq current-prefix-arg nil) + (windmove-up) + (windmove-swap-states-up))) + (use-package nano-theme :straight '(nano-theme :type git :host github :repo "rougier/nano-theme") :init (load-theme 'nano t) (nano-light)) +(use-package windmove :straight nil + :init + (keymap-global-set "S-" #'priime-window-left) + (keymap-global-set "S-" #'priime-window-right) + (keymap-global-set "S-" #'priime-window-down) + (keymap-global-set "S-" #'priime-window-up)) (use-package all-the-icons :straight t) (use-package neotree :straight t :after (all-the-icons)