diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index dc39f863c..322f66801 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -34,7 +34,9 @@ temporary/special buffers in `font-lock-comment-face'." If ARG (universal argument), open selection in other-window." (interactive "P") - (ivy-read "Switch to workspace buffer: " + (ivy-read (if arg + "Switch to workspace buffer in other window: " + "Switch to workspace buffer: ") 'internal-complete-buffer :predicate #'+ivy--is-workspace-or-other-buffer-p :action (if arg @@ -44,6 +46,12 @@ If ARG (universal argument), open selection in other-window." :keymap ivy-switch-buffer-map :caller #'+ivy/switch-workspace-buffer)) +;;;###autoload +(defun +ivy/switch-workspace-buffer-other-window (&optional arg) + "Switch the other window to a buffer within the current workspace." + (interactive) + (+ivy/switch-workspace-buffer t)) + (defun +ivy--tasks-candidates (tasks) "Generate a list of task tags (specified by `+ivy-task-tags') for `+ivy/tasks'." diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index e171d4957..cca0f2969 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -76,7 +76,9 @@ immediately runs it on the current candidate (ending the ivy session)." :hook (ivy-mode . ivy-rich-mode) :config ;; Show more buffer information in other switch-buffer commands too - (dolist (cmd '(+ivy/switch-workspace-buffer + (dolist (cmd '(ivy-switch-buffer-other-window + +ivy/switch-workspace-buffer + +ivy/switch-workspace-buffer-other-window counsel-projectile-switch-to-buffer)) (ivy-set-display-transformer cmd 'ivy-rich--ivy-switch-buffer-transformer)) ;; Use `+ivy-rich-buffer-name' to display buffer names diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 9bfb19cbf..221e634b0 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -34,8 +34,11 @@ "C-S-r" #'helm-resume) ;; Buffer related bindings "C-x b" #'persp-switch-to-buffer + (:when (featurep! :completion ivy) + "C-x 4 b" #'+ivy/switch-workspace-buffer-other-window) "C-x C-b" #'ibuffer-list-buffers "C-x B" #'switch-to-buffer + "C-x 4 B" #'switch-to-buffer-other-window "C-x k" #'doom/kill-this-buffer-in-all-windows ;; Popup bindigns "C-x p" #'+popup/other