I guess I’m an old-timer, but I’ve always preferred the Terminal over all the fancy GUI tools that permeate the space these days. Yes, things like VSCode and Kraken are nice but I still really just prefer CLI tools in a good terminal. Of course, technology improves and the terminal of today is nothing like the terminal of yesteryear.
I spent some time over the last few weeks, inspired by some youtube videos like Josean Martinez and Typecraft, rebuilding my terminal environment and I thought I would share it here.
For background, I’m doing all of this on a MacBook Air 13-inch 2024M3 running Sonoma.
Syncronizing with Stow
First off, I wanted to tidy up how I manage all my environment configuration and dotfiles. For years I’ve had a private repo on github where I dumped everything. It worked, but it meant on a new system running a cryptic collection of shell scripts, that usually broke, and then manually creating a bunch of symlinks.
I replaced this with two things:
- gnu stow- https://www.gnu.org/software/stow/
- A smaller public repo - https://github.com/yeraze/dotfiles
Now, on a new system I just pull down this repo into
~/dotfiles
and run stow .
.. boom, done.Shell - fish
For years, I’ve been using
fish
as my terminal shell. It’s fast, has some nice features, and does everything I need a little less cryptically than tcsh or bash. It has some compatibilitiy problems, but I can usually work around those when they (rarely) crop up.Here is what my terminal looks like these days:
Â
Â
I’m sure you’re probably thinking that doesn’t look like a standard terminal. So let me tell you how I’ve spruced it up:
- Kitty for my Terminal Emulator (switched from iTerm2)
- using
tmux
for multiple terminals and sessions - tmux has
tmux-resurrect
andtmux-continuum
installed so that I preserve everything even between reboots
- oh-my-posh setup to spruce up my terminal
- zoxide, fzf, bat, and eza setup to improve the terminal experience
-
cd
aliased to run zoxide -
ll
aliased to run eza cat
aliased to run bat
- Catppuccin themes applies to all of the above
Full configs for all of this can be found in the dotfiles repo above, but this makes everything 10x faster using the terminal.
- With tmux setup, I have dozens of terminals all at my disposal without having to use the mouse to manage windows or hunt them down.
- With zoxide setup, I no longer have to remember long cryptic paths, or work magic with directory stacks.. Just
cd
to what I want and it’s usually right.
- The terminal prompts give me all the details about not just my location, but my git branch and status, node or pyenv configuration, and more
- I also setup lazygit and sshs with tmux hotkeys so that I can quickly execute a git commit/push or connect to a remote system without having to open a new terminal or anything first.
And configuring the common Mocha theme across everything really ties it all together to make it look and feel like a single coherent user experience.
neovim
Of course, no shell environment would be complete without an Editor. I’ve been a longtime vi, then vim user for 20+ years. I first started using vim back at university when I had to work on a Sun Sparc station. My only options were Emacs or Vim. Vim loaded in 2 seconds, and Emacs took 30, so I chose vim.
I’ve never thought much of it, until I stumbled across some youtube videos about neovim. Still vim at heart, but with lots of the newer niceties. Most importantly, two tools that blew my mind when I first saw them: treesitter and text-objects. If you haven’t seen them before, watch this video and see how now Vim can be language & structure aware to intelligently work on code without breaking syntax.
Â
It took me a day or two to get the hang of it, but WOW it’s a whole new experience. My entire environment is in the dotfiles repo above, but the cliffnotes:
- I started with lazyvim
- I added a ton of additional treesitter plugins
- Added custom plugins for folds & avante
With that and learning a lot of new motions, it’s become a whole new toolset. With this, I can fluidly live within the terminal, and mostly within neovim itself, without ever losing context of what I’m doing. Having the avante sidebar for github copilot support is great, and the inline recommendations and autocompletion capabilities make punching out code a breeze. The improved text-object support makes it easy to indent or modify entire scopes with ease, without having to manually do complicated Visual highlights.
Conclusion
So hopefully you find this useful to improve your own environment. To think you can get all of this capability for free thanks to open source, and still have so much left to tinker and tweak to get it just right, it something I wouldn’t have thought possible when I started this journey 20 years ago.