Skip to content

Commit

Permalink
Cmds like counsel-find-file: Add action on 't' to open in other tab
Browse files Browse the repository at this point in the history
Add action to open in other tab-bar tab to:
- counsel-find-file
- counsel-recentf
- counsel-buffer-or-recentf
- counsel-switch-buffer
- ivy-switch-buffer
  • Loading branch information
Hugo-Heagren committed Sep 22, 2021
1 parent 4de30b0 commit 573f02f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion counsel.el
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,7 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise default to
'counsel-find-file
'(("j" find-file-other-window "other window")
("f" find-file-other-frame "other frame")
("t" find-file-other-tab "other tab")
("b" counsel-find-file-cd-bookmark-action "cd bookmark")
("x" counsel-find-file-extern "open externally")
("r" counsel-find-file-as-root "open as root")
Expand Down Expand Up @@ -2331,6 +2332,7 @@ https://www.freedesktop.org/wiki/Specifications/desktop-bookmark-spec"))
'counsel-recentf
`(("j" find-file-other-window "other window")
("f" find-file-other-frame "other frame")
("t" find-file-other-tab "other tab")
("x" counsel-find-file-extern "open externally")
("d" ,(lambda (file) (setq recentf-list (delete file recentf-list)))
"delete from recentf")))
Expand Down Expand Up @@ -2441,6 +2443,7 @@ This function uses the `dom' library from Emacs 25.1 or later."
'counsel-buffer-or-recentf
'(("j" find-file-other-window "other window")
("f" find-file-other-frame "other frame")
("t" find-file-other-tab "other tab")
("x" counsel-find-file-extern "open externally")))

(defun counsel-buffer-or-recentf-transformer (var)
Expand Down Expand Up @@ -6341,7 +6344,8 @@ in the current window."
(ivy-set-actions
'counsel-switch-buffer
'(("x" counsel-open-buffer-file-externally "open externally")
("j" ivy--switch-buffer-other-window-action "other window")))
("j" ivy--switch-buffer-other-window-action "other window")
("t" 'switch-to-buffer-other-tab "other tab")))

;;** `counsel-compile'
(defvar counsel-compile-history nil
Expand Down
3 changes: 3 additions & 0 deletions ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -4510,6 +4510,9 @@ Otherwise, forward to `ivy-kill-line'."
("j"
ivy--switch-buffer-other-window-action
"other window")
("t"
switch-to-buffer-other-tab
"other tab")
("k"
ivy--kill-buffer-action
"kill")
Expand Down

0 comments on commit 573f02f

Please sign in to comment.