aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--evil-commands.el12
-rw-r--r--evil-maps.el6
2 files changed, 15 insertions, 3 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 3d625a7..2198a0c 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -4782,6 +4782,18 @@ and redisplay the current buffer there."
:repeat nil
(evil-move-window 'below))
+;;; Tab commands
+
+(evil-define-command evil-tab-next (arg)
+ "Switch to the next tab.
+If ARG is non-nil, parse ARG as an index and go to the tab at that
+index."
+ :repeat nil
+ (interactive "<c>")
+ (if arg
+ (tab-bar-select-tab arg)
+ (tab-bar-switch-to-next-tab)))
+
;;; Mouse handling
;; Large parts of this code are taken from mouse.el which is
diff --git a/evil-maps.el b/evil-maps.el
index f263a63..2834d5a 100644
--- a/evil-maps.el
+++ b/evil-maps.el
@@ -189,8 +189,8 @@
(define-key evil-window-map [C-right] 'evil-window-right)
(when (featurep 'tab-bar)
- (define-key evil-motion-state-map "gt" 'tab-bar-switch-to-next-tab)
- (define-key evil-window-map "gt" 'tab-bar-switch-to-next-tab)
+ (define-key evil-motion-state-map "gt" 'evil-tab-next)
+ (define-key evil-window-map "gt" 'evil-tab-next)
(define-key evil-motion-state-map "gT" 'tab-bar-switch-to-prev-tab)
(define-key evil-window-map "gT" 'tab-bar-switch-to-prev-tab))
@@ -588,7 +588,7 @@ included in `evil-insert-state-bindings' by default."
(evil-ex-define-cmd "tabnew" 'tab-bar-new-tab)
(evil-ex-define-cmd "tabc[lose]" 'tab-bar-close-tab)
(evil-ex-define-cmd "tabo[nly]" 'tab-bar-close-other-tabs)
- (evil-ex-define-cmd "tabn[ext]" 'tab-bar-switch-to-next-tab)
+ (evil-ex-define-cmd "tabn[ext]" 'evil-tab-next)
(evil-ex-define-cmd "tabp[revious]" 'tab-bar-switch-to-prev-tab))
;; Command-line editing