https://github.com/manateelazycat/sort-tab
Smarter tab solution for Emacs, sort tab with using frequency.
https://github.com/manateelazycat/sort-tab
Last synced: 8 months ago
JSON representation
Smarter tab solution for Emacs, sort tab with using frequency.
- Host: GitHub
- URL: https://github.com/manateelazycat/sort-tab
- Owner: manateelazycat
- Created: 2021-10-26T08:03:07.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-06T15:17:22.000Z (about 1 year ago)
- Last Synced: 2024-12-30T19:34:58.992Z (10 months ago)
- Language: Emacs Lisp
- Size: 545 KB
- Stars: 54
- Watchers: 8
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
# What is sort-tab?
sort-tab is smarter tab solution for Emacs, it sort tab with using frequency.sort-tab stay on top of Emacs, it won't waste any vertically space when you split window.
## Installation
1. Clone or download this repository (path of the folder is the `` used below).
2. In your `~/.emacs`, add the following two lines:
```elisp
(add-to-list 'load-path "") ; add sort-tab to your load-path
(require 'sort-tab)
(sort-tab-mode 1)
```## Usage
* sort-tab-select-next-tab: select next tab
* sort-tab-select-prev-tab: select previous tab
* sort-tab-select-first-tab: select first tab
* sort-tab-select-last-tab: select last tab
* sort-tab-close-current-tab: close current tab#### SwitchTabByIndex
You can bind the number keys to the command ```sort-tab-select-visible-tab```, such as s-1, s-2, s-3 ... etc.```
(global-set-key (kbd "s-1") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-2") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-3") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-4") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-5") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-6") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-7") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-8") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-9") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-0") 'sort-tab-select-visible-tab)
(global-set-key (kbd "s-Q") 'sort-tab-close-all-tabs)
(global-set-key (kbd "s-q") 'sort-tab-close-mode-tabs)
(global-set-key (kbd "C-;") 'sort-tab-close-current-tab)
```This function automatically recognizes the number at the end of the keystroke
and switches to the tab of the corresponding index.## Option
* sort-tab-hide-function: you can customize this function to hide tab that match some rule, example, if we want hide all dired buffer, you can customize this function like this `(setq sort-tab-hide-function '(lambda (buf) (with-current-buffer buf (derived-mode-p 'dired-mode))))`