summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/ui-navigation.el46
1 files changed, 29 insertions, 17 deletions
diff --git a/modules/ui-navigation.el b/modules/ui-navigation.el
index 77d1fcbe..f2b743ac 100644
--- a/modules/ui-navigation.el
+++ b/modules/ui-navigation.el
@@ -51,25 +51,37 @@
;; ------------------------------ Window Splitting -----------------------------
-;; SPLIT VERTICALLY
-(defun split-and-follow-right ()
- "Open a new window horizontally to the right of the current window.
-Open ibuffer in the other window for easy buffer selection."
+(defun cj/split-and-follow-right ()
+ "Like =ivy-switch-buffer-other-window' but always split horizontally."
(interactive)
- (split-window-right)
- (other-window 1)
- (ibuffer))
-(global-set-key (kbd "M-V") 'split-and-follow-right)
-
-;; SPLIT HORIZONTALLY
-(defun split-and-follow-below ()
- "Open a new window vertically below the current window.
-Open ibuffer in the other window for easy buffer selection."
+ (let ((split-height-threshold nil) ; Disable vertical splitting
+ (split-width-threshold 0)) ; Always prefer horizontal splitting
+ (ivy-switch-buffer-other-window)))
+(global-set-key (kbd "M-V") 'cj/split-and-follow-right)
+
+(defun cj/split-and-follow-below ()
+ "Like =ivy-switch-buffer-other-window' but always split vertically."
(interactive)
- (split-window-below)
- (other-window 1)
- (ibuffer))
-(global-set-key (kbd "M-H") 'split-and-follow-below)
+ (let ((split-height-threshold 0) ; Always prefer vertical splitting
+ (split-width-threshold nil)) ; Disable horizontal splitting
+ (ivy-switch-buffer-other-window)))
+(global-set-key (kbd "M-H") 'cj/split-and-follow-below)
+
+;; (defun cj/split-and-follow-right ()
+;; "Open a new window horizontally to the right of the current window.
+;; Open ibuffer in the other window for easy buffer selection."
+;; (interactive)
+;; (split-window-right)
+;; (other-window 1)
+;; (ibuffer))
+
+;; (defun cj/split-and-follow-below ()
+;; "Open a new window vertically below the current window.
+;; Open ibuffer in the other window for easy buffer selection."
+;; (interactive)
+;; (split-window-below)
+;; (other-window 1)
+;; (ibuffer))
;; ------------------------- Split Window Reorientation ------------------------