feat(emacs): add better window manipulation commands
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
99d9a27cce
commit
c7862baf18
2 changed files with 37 additions and 1 deletions
|
@ -185,7 +185,6 @@
|
||||||
(global-so-long-mode 1)
|
(global-so-long-mode 1)
|
||||||
|
|
||||||
(rassq-delete-all 'auto-save-mode auto-mode-alist)
|
(rassq-delete-all 'auto-save-mode auto-mode-alist)
|
||||||
(windmove-default-keybindings)
|
|
||||||
(put 'scroll-left 'disabled nil)
|
(put 'scroll-left 'disabled nil)
|
||||||
(put 'scroll-right 'disabled nil)
|
(put 'scroll-right 'disabled nil)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
(require 'projectile)
|
(require 'projectile)
|
||||||
(require 'magit)
|
(require 'magit)
|
||||||
|
|
||||||
|
;;; Neotree
|
||||||
|
|
||||||
(defun neotree-toggle-dir-or-project ()
|
(defun neotree-toggle-dir-or-project ()
|
||||||
"By default, toggle the directory at the project level, with prefix current."
|
"By default, toggle the directory at the project level, with prefix current."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -37,12 +39,47 @@
|
||||||
(neotree-hide)
|
(neotree-hide)
|
||||||
(neotree-dir dir)))
|
(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
|
(use-package nano-theme
|
||||||
:straight '(nano-theme :type git :host github
|
:straight '(nano-theme :type git :host github
|
||||||
:repo "rougier/nano-theme")
|
:repo "rougier/nano-theme")
|
||||||
:init
|
:init
|
||||||
(load-theme 'nano t)
|
(load-theme 'nano t)
|
||||||
(nano-light))
|
(nano-light))
|
||||||
|
(use-package windmove :straight nil
|
||||||
|
:init
|
||||||
|
(keymap-global-set "S-<left>" #'priime-window-left)
|
||||||
|
(keymap-global-set "S-<right>" #'priime-window-right)
|
||||||
|
(keymap-global-set "S-<down>" #'priime-window-down)
|
||||||
|
(keymap-global-set "S-<up>" #'priime-window-up))
|
||||||
(use-package all-the-icons :straight t)
|
(use-package all-the-icons :straight t)
|
||||||
(use-package neotree :straight t
|
(use-package neotree :straight t
|
||||||
:after (all-the-icons)
|
:after (all-the-icons)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue