reddit / emacs
Questions About Emacs Workflow
FearlessPolicy3206 · 2022-07-11 18:34
[removed]
BettaGeorge · 2022-07-11 19:13
Did you not use splitting in vim?
paretoOptimalDev · 2022-07-11 19:29
> I use buffers as a way to have related tasks stacked on top of each other within one area, but this utility seems fairly limited.
What do you do when you are on project B and want to open a new buffer from project A?
Can you explain more how this workflow works?
WallyMetropolis · 2022-07-11 20:20
I can tell you what I do. I suspect it's common and possibly the majority of experienced users do something similar.
To make sure we're using the same terminology, I'll try to call things by their correct names, as specified, e.g. [here](https://emacs.stackexchange.com/questions/13583/whats-the-difference-between-a-buffer-a-file-a-window-and-a-frame).
I only have a single instance of Emacs running at any given time. Though because I run an emacs server, when I do something like open a file from the command line or initiate a git commit, it will start a new client. I very rarely use two frames simultaneously, but often have multiple windows open. For example, I may have a narrow window on the left for directory navigation, one on top with code and one below connected to a shell or a REPL. Possibly one with documentation. It's a large package but there is a lot of helpful window, frame, and buffer management available from `hyperbole`.
I use `projectile` to switch between projects, but I use it only very lightly. (There are other similar kinds of packages, project.el is built in and would probably be fine for my needs, but if it ain't broke ...). I don't worry at all about how many buffers I have open. But when I'm done working on a particular task it can be very satisfying to use `projectile-kill-buffers` to close everything related to that task. Like closing all the browser tabs I opened looking at docs and SO.
I use `vertico` (or previously Selectrum, Ivy, or Helm) to quickly find whatever open buffer I'd like to switch to. I use ripgrep (`rg.el`) for searching and projectile for limiting search to within a project. I sometimes use `treemacs` to get a sidebar with a file browser, but do most of my directory and file navigation with `Dired` which is amazing but has a small learning curve.
One thing I've added in the last couple years that I really like is using Emacs as my command line client. I don't know how well this is supported in a Windows environment, but `multi-vterm` has been a really great tool for me.
I don't know if this is in anyway helpful for you, but I'm happy to answer any questions you have.
[deleted] · 2022-07-11 20:29
[removed]
podtatranec · 2022-07-11 20:50
Most people who transition from vim go thorough phases of usage (at least I did). You describe one phase where you use/open emacs as if it was vim. It works, but eventually...
You might get to a place where having super consistent experience within emacs will be worth staying in emacs instead of relying on other pieces of software. I think you already use server mode and emacs client so you are on the way...
For what it's worth I usually keep several emacs frames (most people would call them windows). One is more or less permanently in notmuch search view of my emails, another frame shows my agenda and org stuff and then there's the main development frame which has treemacs with various projects which I switch between. I usually have multiple windows within the frame (learning to efficiently split made a huge difference). I rely a lot on history to reopen files I've visited in the past. For most dev stuff I don't need to leave emacs anymore.
Another big thing is learning to use magit and forge. I am still working on it, but I already see efficiency gains in some ways.
Everyone's journey is different however.
xtifr · 2022-07-11 22:06
One of the things about Emacs is that there really *isn't* a *preferred* workflow! Emacs is designed to be super-customizable so that it can adapt to *your* preferred workflow, rather than the other way around.
Of course, this can mean a little extra work up front, as you try to determine what you would like it to do, and how to make it do that, and maybe experiment with different approaches, but in the long run, all that flexibility can *more* than pay for itself!
jsonr_r · 2022-07-11 22:55
Emacs predates window managers, and predates window managers with useful features by even more. Today you might be able to do everything you want in the window manager, but that wasn't always the case, hence why Emacs has window and frame manipulation built in.
dpoggio · 2022-07-12 00:19
You could use projectile or ibuffer… I just don’t use any kind of buffer grouping at all. I consider it to be more of a mess and a bit naive. See, why do you group? To look at a tidy list afterwards, usually. I don’t want to look at any lists. I may have dozens of buffers and no time to even think about how are those related. Instead, I type whatever I remember about the buffer, and narrow my search like “aut q s$” (a buffer name containing both “aut” and “q”, and ending with “s”). This is a lot faster (to me) and needs no other setup than binding helm functions to replace things like `C-x C-b`. I also tend to not use more than one frame unless I’m using a second screen. I can change buffers as fast as I can change frames, so it’s pointless to me.
onetom · 2022-07-12 03:21
what do you mean by "learning to efficiently split"
?
I've adjusted my `split-{height,width}-threshold` to 200/0 so`split-window-sensinly` prefers splitting to the right, but I often find myself running `balance-windows` immediately afterwards.
timmymayes · 2022-07-12 06:20
Emacs is certainly a customize it to what you want environment. Ultimately you're a bit on the standard track " a unified control scheme".
As you're going along consider adding in some universal tools like magit for using git, mu4e for using email, org mode for tracking your todos, projectile for project management, etc. Many of these are tools you'd use across your workflow. As such, to me it seems odd to have a seperate window for say Magit when I can just pop-off a hotkey to enter a magit buffer for my current project to commit or use a capture template to capture a task related to my code.
For me emacs is a zen, flow-state app that handles just about all of my needs.
podtatranec · 2022-07-12 07:13
re efficiently split - being able to work with multiple windows in a single frame, splitting vertically/horizontally as needed and being able to jump between the windows quickly using shortcuts.
It depends on personal preferences and your HW (monitor resolution, etc). But the point I guess is - on large monitors having a single window within a frame is often a waste of space. So having setup with sidekick windows with additional information, temporary shells etc can be super useful (and depends on what you actually do at the time). My frame for Python coding might look quite a bit different than when I am doing some ELisp tweaks.
[deleted] · 2022-07-12 07:46
[removed]
mclearc · 2022-07-12 14:53
I tend to use a single emacs instance and single frame with multiple tabs as workspaces using [tabspaces](https://github.com/mclear-tools/tabspaces) (I'm the maintainer). That lets you group buffers by tab (which means by window configuration), and there is an option to connect tabs with specific "projects", as understood by the built-in `project.el`. I tend to have a tab for my agenda, another for email, and then tabs for whatever projects I'm working on. I've been doing this for a couple years and it works pretty well for me but YMMV.
xrabbit · 2022-07-12 18:12
what is your main reason for switching from neovim to emacs?
Is it comfortable to use emacs key chords with vim background?
is it more complicated to create/update emacs config in elisp that neovim in lua/fennel?