Thanks for this package Colin! I've recently made the switch to using tabs (rather than perspectives), and I really like the simplicity of the package.
I'm sharing the code below as it might be useful to others. Hopefully this is the right place to do so.
When I have many tabs open, I like to switch between them quickly. One way to do this is via frog-menu which pops up a posframe and uses avy keys to select a candidate. More on frog-menu here: https://elpa.gnu.org/packages/frog-menu.html
In short: the code below allows to (1) pop-up a list of tabs in a posframe, and (2) switch to a tab by typing a single key (based on the first letter of the key). It takes inspiration from https://github.com/waymondo/frog-jump-buffer
Generating the keys for switching perspectives is done via a separate function.
(defun efls/frog-tabs-generate-keys (tabs)
"Generate keys for TABS (a list of tab names).
Returns a list of first chars from each tab. If two chars are
identical, make second capitalized. If more chars than two are
identical, then... nothing else."
(let ((new-chars))
(dolist (char (-map (lambda (s) (string (string-to-char s)))
tabs))
(if (member char new-chars)
(setq new-chars (append new-chars (list (capitalize char))))
(setq new-chars (append new-chars (list char)))))
(-map 'string-to-char new-chars)))
It works as follows:
Create a list of tab names.
Construct a list of strings with first character of each tab name.
Make a new list where each repetition of a char is capitalized.
Turn that list of strings into a list of characters.
There are potential issues:
when more than two tab names start with the same character
when a tab name starts with something other than an alphabetic character
Thanks for this package Colin! I've recently made the switch to using tabs (rather than perspectives), and I really like the simplicity of the package.
I'm sharing the code below as it might be useful to others. Hopefully this is the right place to do so.
When I have many tabs open, I like to switch between them quickly. One way to do this is via
frog-menu
which pops up a posframe and uses avy keys to select a candidate. More on frog-menu here: https://elpa.gnu.org/packages/frog-menu.htmlIn short: the code below allows to (1) pop-up a list of tabs in a posframe, and (2) switch to a tab by typing a single key (based on the first letter of the key). It takes inspiration from https://github.com/waymondo/frog-jump-buffer
Generating the keys for switching perspectives is done via a separate function.
It works as follows:
There are potential issues: