reddit / emacs

Currently using buffer list

Two_Souls · 2022-07-13 23:45
Recent convert from Neovim to Emacs and am really enjoying working in Emacs. I have one little thing I have found to slow me down a little and wondering whether you guys had some suggestions. I used to have a buffer line with my current open buffers in Neovim and this allowed me to have 2-4 buffers/files in the bufferline that I was working on. It meant that I didn't have to think about which file I want to skip forward or back to - I would just look at the buffer line and then prev or next or wildcard to the buffer I want to skip to. In Emacs you do end up with a lot more open buffers so something similar wouldn't quite work but I wonder whether there are other solutions that might solve my issue. I would be perfectly happy to mark the buffers that I am currently working on for example and have them displayed somewhere for ease. Or have them pop up at the top of my buffer or ibuffer list so they are easy to see and select. Any suggestions?
naokotani · 2022-07-14 00:10
I use persp mode and projectile and keep my buffers separated by protect, which helps significantly. I also suggest using something like vertico for switching buffers.
Hagge5 · 2022-07-14 00:10
I could be misunderstanding what you're looking for, but is it maybe something like [https://github.com/ema2159/centaur-tabs](https://github.com/ema2159/centaur-tabs) ? I haven't used it, but it enables you to see buffers at the top of your frame, and there's even a section in the readme about vim-style tab motions. It also has a chapter about buffer reordering. I haven't looked into it, but maybe you could write some code to manipulate that if you want to be able to mark a set of buffers to always keep in view, if you really need it. I'm sure there are ways of manipulating the priority of buffers in the buffer list. I found bury-buffer, which puts one at the end of the 'buffer list', though it doesn't point to a specific variable for you to manipulate. You'd probably have to do some digging.
orzechod · 2022-07-14 00:21
if you want a persistent list of buffers, then I believe you can enable the [speedbar](https://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html) and place it in buffer-display mode by typing `b`. if you're ok with a transient list of buffers that puts the most recently-visited buffers at the head of the list then check out an all-in-one framework like helm or ivy, or a set of related tools like selectrum+prescient. when configured properly, these tools will (along with lots of other things) enhance your `C-x b` experience to sort by recency or whatever other criteria you want.
flexibeast · 2022-07-14 00:43
Might Emacs' tabs system, `tab-bar-mode`, work for you?
TunaCowboy · 2022-07-14 02:24
`centaur-tabs` + `neotree` + `projectile` and OP is golden.
Illiamen · 2022-07-14 02:24
And also `tab-line-mode`: https://www.gnu.org/software/emacs/manual/html_node/emacs/Tab-Line.html
mclearc · 2022-07-14 03:52
Related to `tab-bar-mode` and `tab-line` there is [tabspaces](https://github.com/mclear-tools/tabspaces), which lets you group buffers by project for easy switching. It uses the built-in `tab-bar` and `project` libraries.
Two_Souls · 2022-07-14 05:53
Would be great to see a screenshot in that readme.
Two_Souls · 2022-07-14 06:02
>https://github.com/ema2159/centaur-tabs I think this is the one. You can set it up so that it doesn't show some buffers in the tabs (like logs etc). I'll have a play. Cheers!
grimscythe_ · 2022-07-14 07:13
Have you tried "helm" yet?
Two_Souls · 2022-07-14 07:29
I have not but heard the name banded around a bit.
grimscythe_ · 2022-07-14 08:00
Do give it a try, it eases the pain for a lot of things.
Two_Souls · 2022-07-14 10:12
I'll check it out. Cheers!
mclearc · 2022-07-14 16:15
[Done](https://github.com/mclear-tools/tabspaces) -- thanks!
CulturMultur · 2022-07-15 22:34
Try frog-jump-buffer, if you configure it to recent files, then they will be all available under one char. I bind `s-b` to frog-jump-buffer, then `s-b b` always goes to previous buffer, repeating it will cycle back and forth between two buffers. ``` (use-package frog-jump-buffer :config (setq frog-jump-buffer-default-filters-capital-letters nil frog-jump-buffer-default-filter 'frog-jump-buffer-filter-recentf frog-menu-avy-keys (string-to-list "gbfdjkhlsaqw"))) ```
dpoggio · 2022-07-16 18:25
I was just about to comment the same. I don’t group buffers. I just use Helm to narrow searches. It’s faster, easier, scalable.
github-alphapapa · 2022-07-17 18:01
I've been meaning to ask you: It seems like we're working on very similar ideas, between tabspaces, [Bufler](https://github.com/alphapapa/bufler.el) (especially `bufler-workspace-mode`), and [Burly](https://github.com/alphapapa/burly.el) (especially `burly-tabs-mode`). I'd love to talk with you about ideas and how we could collaborate, cooperate, or co-inspire on these projects. I think that we're all trying to fill some obvious gaps in Emacs's buffer management, and exploring solutions as we go.
mclearc · 2022-07-17 18:33
Yeah would be very happy to hear your views. `tabspaces` started largely from seeing how much I could get out of stock emacs to replace a few packages I had been using. I like bufler, but I find that `consult-buffer` suits my needs, especially given the workspace isolation. I have thought a bit about session management with tabspaces but haven't really had time to try anything, and of course packages like yours already do much of this. And since (unlike yourself) I basically have no idea what I'm doing with the code, I am trying to keep things as simple as possible. But if you have any thoughts I'd be very happy to hear them, so please feel free to open an issue on tabspaces and we can discuss.
Two_Souls · 2022-07-18 02:55
Interesting thanks, will check it out.
github-alphapapa · 2022-07-18 14:24
> I like bufler, but I find that consult-buffer suits my needs, especially given the workspace isolation. Just FYI, `bufler-workspace-mode` does that as well when used with `bufler-switch-buffer`, i.e. it only presents buffers from the current workspace (and with universal prefixes, from others). The intended advantage is to make use of Bufler's programmable grouping so users don't have to manually put buffers in workspaces. > And since (unlike yourself) I basically have no idea what I'm doing with the code, I am trying to keep things as simple as possible. You sell yourself short, but keeping it simple is always smart. :) > But if you have any thoughts I'd be very happy to hear them, so please feel free to open an issue on tabspaces and we can discuss. Ok, thanks. It may be a while, as I've got other projects at the fore right now, but if I come up with something, I will. Feel free to contact me if you have any thoughts as well.
mclearc · 2022-07-18 14:30
Sounds good! I'm also swamped these days, but will keep this in mind, thanks.