2020-09-02 22:46:49 +00:00
|
|
|
#+TITLE: Tabs layer
|
|
|
|
|
2020-10-03 18:54:32 +00:00
|
|
|
#+TAGS: emacs|layer|spacemacs
|
|
|
|
|
|
|
|
* Table of Contents :TOC_5_gh:noexport:
|
2020-09-02 22:46:49 +00:00
|
|
|
- [[#description][Description]]
|
|
|
|
- [[#features][Features:]]
|
|
|
|
- [[#install][Install]]
|
2022-02-04 05:36:26 +00:00
|
|
|
- [[#configuration][Configuration]]
|
|
|
|
- [[#selected-tab-bar][Selected tab bar]]
|
|
|
|
- [[#hide-tabs-after-a-delay][Hide tabs after a delay]]
|
2020-09-02 22:46:49 +00:00
|
|
|
- [[#key-bindings][Key bindings]]
|
|
|
|
|
|
|
|
* Description
|
|
|
|
This layer adds support for tabs. Implementation is done using [[https://github.com/ema2159/centaur-tabs][Centaur Tabs]].
|
|
|
|
|
|
|
|
** Features:
|
2020-10-03 18:54:32 +00:00
|
|
|
- Sets up tabs using Centaur tabs as backend
|
2020-12-16 19:10:39 +00:00
|
|
|
- Optionally auto hide tabs after delay
|
2020-09-02 22:46:49 +00:00
|
|
|
|
|
|
|
* Install
|
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
|
|
|
add =tabs= to the existing =dotspacemacs-configuration-layers= list in this
|
|
|
|
file.
|
|
|
|
|
2022-02-04 05:36:26 +00:00
|
|
|
* Configuration
|
|
|
|
** Selected tab bar
|
|
|
|
To display a bar in the given direction to the selected tab, set =tabs-highlight-current-tab= to
|
|
|
|
one of =left= (default), =under=, =over=.
|
|
|
|
|
|
|
|
For example,
|
2022-02-04 05:39:59 +00:00
|
|
|
|
2022-02-04 05:36:26 +00:00
|
|
|
#+BEGIN_SRC emacs-lisp
|
2022-02-04 05:39:59 +00:00
|
|
|
(setq-default dotspacemacs-configuration-layers
|
|
|
|
'(tabs :variables tabs-highlight-current-tab 'left))
|
2022-02-04 05:36:26 +00:00
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Note that this has no effect when Emacs is running in daemon mode.
|
|
|
|
|
|
|
|
** Hide tabs after a delay
|
2020-09-02 22:46:49 +00:00
|
|
|
You can set hooks for buffers in which it isn't desired to have tabs by
|
2022-02-04 05:36:26 +00:00
|
|
|
customizing =centaur-tabs-hide-tabs-hooks=.
|
2020-09-02 22:46:49 +00:00
|
|
|
|
2022-02-04 05:36:26 +00:00
|
|
|
Alternatively you can set =tabs-auto-hide= to =t= to auto hide tabs after some
|
|
|
|
delay =tabs-auto-hide-delay= via the :variables keyword in your =.spacemacs=:
|
2020-12-16 19:10:39 +00:00
|
|
|
|
2021-02-13 22:58:15 +00:00
|
|
|
#+BEGIN_SRC emacs-lisp
|
2022-02-04 05:39:59 +00:00
|
|
|
(setq-default dotspacemacs-configuration-layers
|
|
|
|
'(tabs :variables
|
|
|
|
tabs-auto-hide t
|
|
|
|
tabs-auto-hide-delay 3))
|
2021-02-13 22:58:15 +00:00
|
|
|
#+END_SRC
|
2020-12-16 19:10:39 +00:00
|
|
|
|
2020-09-02 22:46:49 +00:00
|
|
|
* Key bindings
|
|
|
|
|
|
|
|
| Key binding | Description |
|
|
|
|
|-------------+-------------------------------------------------------|
|
2022-02-04 05:36:26 +00:00
|
|
|
| ~g t~ | Select the next available tab |
|
|
|
|
| ~g T~ | Select the previous available tab |
|
|
|
|
| ~g C-t~ | Move current tabe to right |
|
|
|
|
| ~g C-T~ | Move current tabe to left |
|
2020-09-02 22:46:49 +00:00
|
|
|
| ~C-c t s~ | Display a list of current buffer groups using Counsel |
|
|
|
|
| ~C-c t p~ | Group buffer tabs by projectile |
|
|
|
|
| ~C-c t g~ | Group buffer tabs by groups |
|