After writing about switching buffers in emacs last year. I keep looking for the way to switch buffer quicker and more comfortably. I mentioned the package awesome-tab in that post and I'm still using it.
The package shows buffers as tabs in emacs header line, and provides functions to switch to next/prev, first/last tab. It also groups buffers depends on project and major-mode.
I write a patch for the package to add function to jump to specifc tab recently. So that user can jump to specific tabs with different shortcuts.
I also write a patch for company-mode to customize the company candidate numbers when company-show-numbers is set to t.
Now I can use the home row the way I want in emacs. Check the screenshot below.
As you can see in the picture, instead of numbers, there're "asdf" for both tabs and completion candidates. Next step is to switch/select tabs/candidates with home row shortcuts.
Above code uses goku and karabiner to map m+asdfg and v+hjkl; to C-x C-6 1234567890. That's 'm' key down then click 'a' to C-x C-6 1 in emacs. Then I map C-x C-6 + numbers to functions that switch/select tabs/candidates in emacs.
Talking about buffer switching in emacs in the last post , I said that I have keybindings to switch between the two and three most recent used buffers. And the author of the reddit post chose to use buffer-flip package.
The buffer-flip package makes switching buffer like those switching applications behavior in operating system, like alt-tab in MS Windows and command-tab in macOS. VScode also can switch among opened files with control-tab. The problem of these methods are obvious. They can only switching in a specific order and they all bind to these uncomfortable keys.
I deploy it to the macOS package manager homebrew so that user can install it with homebrew easily. Since the tool is used to watch the edn file and transform it to json file. It's naturally to use homebrew services to run the command.
Homebrew services uses macOS's launchctl tool to read plist file and run service. The problem is launchctl create the log directory I set in the plist file with system permission, and the program don't need to run under system permission. So the service failed.
Recently there's a new post on r/emacs discussing about swithcing buffer in emacs. As I posted before, I have that kind of problem as well. It's just most of us use ibuffer, helm or ivy and we use them for a long time. Yet we still interest in these discussions. Cause maybe all of us want it to be faster or more convenient.
For me, I use counsel-projectile-switch-to-buffer and ivy-switch-buffer to switch buffer in current project or global. And I have two functions to switch between the two and three most recent buffer.
After last post about tring emacs workspace management, I tried persp-mode. It comes out that it's not that simple to implement a workspace auto-switch feature. It's not just find-file-hook and advice for switch-buffer. There are too many commands need to advice and hook (select-window, kill-buffer-hook ...). Cause there's no "buffer-focus-in-hook". And it's not easy to build one with persp-mode.
There is one package in melpa that implement per buffer buffer-focus-in-hook and buffer-focus-out-hook by hacking on buffer-list-update-hook. But persp-mode also manipulate the buffer-list. It won't work out.
Then I realize that I just want to have workspace on buffer management, like the ibuffer option above. I can easily get that feature. I just rebind my buffer-switch key to counsel-projectile-switch-to-buffer and everything works great.
It turns out that compared with projectile, persp only offers workspace specific window configuration. So I don't need it if I only want buffer level workspace. And it also add unexpacted behavior when I test my auto-switch implementation (buffer and window configuration switched at the same time), which makes me wonder that workspace auto-switch is a bad idea.
Although it looks like that I waste bunch of time to find a single rebind. I do find lots useful stuff on these workspace, layout, window management packages and implementations. I might write another post for about that.
Recently I'm asked to help on a project. The problem is there're a lot files with same name in different directories and same name with my other project. I'm using ivy-switch-buffer to switch between opened buffer. And it needs more keystrokes in this project to switch to the desired buffer. So I'm looking for some workspace management aproch in emacs to make my finger not that tired after work.
After googling for a little while, I find there are so many ways to manage workspace in emacs.
also there's ibuffer with ibuffer-vc or ibuffer-projectile
even tabbar with custom filter functions
The cons of the first two is that you need to deliberately switch workspace when you are going to open files in other workspace. The pros is that they provide perfect isolation, no need to tweak buffer switch functions.
For persp-mode, the pros is that with custom code, maybe it's not hard to implement the workspace auto-switching function. It has eye candy in mode line or title bar if you want them. The cons is that you need to implement the auto-switching function or remember to switch workspace manually.
For purpose-mode, you may need multiple high resolution screen.
For ibuffer, it's not typically "workspace". It depends on how many buffers you have and how familiar you are with the ibuffer filter functionality.
For tabbar, eye candy and custom function is needed.
My config in KE-complex-modifications is outdated. I'm now using GokuRakuJoudo to config karabiner. It enables user to write the configuration in a much more compact karabiner.edn file, you can check out mine. I'll write a post about it soon. If your karabiner.json is bloated, you may want to try it. Recommend to check the tutorial first.
I merged my personal Karabiner Elements configuration into the official repo several days ago. You can import my personal rules here. To achieve efficiency, I use karabiner with Alfred mainly through alfred workflow external trigger and osascript (command line tool for calling AppleScript code). Here are these configurations. Please note that I update my configurations every day. So I can't keep this post up to date. The key here is to introduce a system for launching apps, invoking scripts and all stuffs that can be done with shell (everything). When you can get anything you want with few key strokes, it feels great.
Update: The old download link is broken and I don't have time to maintain all these workflows up to date. Now that the core thing here is to use alfred workflow's external trigger feature, I create a app launcher workflow as a sample.
I used to use vim with tmux in a terminal emulator. After changing to emacs. It didn't take much time for me to realize that emacs in GUI works better.
The problem is I still want the old behavior. I tried about three times using my zsh shell in emacs. I'm not here telling those failed attempts. I want to write it down because of a recent discovery.
When I restructure my zsh configurations, I find the z-shell works fine with with zero config. That's when I finally discover that it's the plugins and configurations that make zsh and emacs incompatible. What's more, I find these lines. They must come from some emacs package's readme instruction. The original one is telling zsh don't do something when it's in emacs.
if [ -n "$INSIDE_EMACS" ]; then
So I thought, I can just use these line with my zsh configuration(prezto). It works fine now after some little test. It turns out the default zsh-autocompletion is not playing well with emacs. I use the if...else code telling zsh don't load autosugestion while in emacs. And everything is fine now.
That's it. Maybe I'll dig in for getting autocompletion back in emacs someday.
Just finish the Halt and Catch Fire, really great show. It makes me think about that everyone is full of story in their life, amazing to others but definitely not to themselves, like Joe in the series.
It's just that I think Joe is "right" in some way. The right is some kind of his every decision of fresh start, it's so decisive. It makes the character fear nothing. He desires success so much but go through his failer and go for the fresh start so quick. But on the other hand, he is so emotional, about his failer, about Gordon's die.
These characters normally can't be on the same person. Maybe that's why it makes me think Joe is "right".