Change for productivity and joy

productivity
neovim
tmux
wezterm
Author

Erik Lundevall-Zara

Published

January 24, 2024

A change of laptop resulted in some changes how I work, and also a bit more joy in doing the work, and also on the way to be more productive. This happened.

Recently, I got to a point that I needed to fix my work laptop. My 5+ years’ old work laptop, a MacBook Pro, was going downhill faster and faster. Battery lasted maybe 1 hour if it were fully loaded, actually charging the laptop did not always work as well.

I asked my employer that probably needed to get a new laptop soon, and what was the options and budget were. I could pick whatever I wanted within certain budget constraints. The result was a new laptop with the same amount of memory and disk storage as before, a better processor, and a smaller screen.

The disk of my old laptop was pretty much full, and a smaller screen (14 inch instead of 15.4 inch) resulted in that I took some time to think through how I worked and what I had installed.

Less clutter

After one month with the new laptop, my disk usage of the 512GB disk is a bit more than 100GB, and it is a cleaner setup than my old laptop. Fewer tools and installations, and better organisation, I think.

This process resembled a Marie Kondo moment, where I kept the things that bring me joy and are necessary, and expressed gratitude for the old things that I no longer need.

I am glad that I took the time to make this cleanup. It was long overdue.

Tool changes

The disk space is on a pleasant path to be in more control and more joyful to handle. What about the tooling?

Initially, the tools I use regularly were the same. This meant VS Code for most of my editing tasks, and the regular macOS terminal for the command-line tasks, and regular macOS Finder for various file management.

However, with a smaller screen on the laptop, I felt that editing space got more cramped, in particular if I used Clojure and Calva for editing Clojure in VS Code.

This led me to decide to try out an editor so that I could run in the terminal window. Initially, I thought of Emacs, which I had used a lot back in the 80s and 90s. After an initial look at the Spacemacs and Doom Emacs distributions. I decided to not pursue that path.

It is hard to say exactly why, but reading some docs and installation instructions did not entice me to try it out.

So then I thought of Vim. I have used vim from time to time for quick edits of text files, and I have also used vi in the past, but it has never been my editor of choice.

I knew some vi commands, but could not really say what was the difference between vi and vim.

I was also aware of NeoVim, but not really knew what was the difference between NeoVim and Vim.

However, I knew that there were many plugins for NeoVim for multiple languages and tools, so I examined that further.

I learned that NeoVim is a fork of Vim, and one feature that is different is that it has built-in support to use the Lua programming language for configuration, while Vim uses Vimscript primarily.

Into the rabbit hole

NeoVim and Vim are modal editors, so you switch between different modes, depending on what you are doing. In one mode, you insert text, and in another mode, you navigate the text and perform some editing.

Since you can always insert text in most other editors, this is a point of confusion for many people.

It takes some time to get used to, but I think it is worth it. By setting up things this way, you do not have to handle different key combinations like ctrl-shift-alt-K, where you have to use a couple of fingers at the same time. Instead, you press one key at a time, and perhaps a couple of them after each other.

At most you may have two keys pressed at the same time.

It takes a bit of time to get used to, but I think it is worth it. It has been about 1 1/2 week since I used NeoVim, and I struggled the first few days, but it was not only with the modal editing but also adding some plugins and a usable theme for the editor, plus a better workflow with the terminal.

My starting point for making NeoVim more useful was the Nvim Kickstart. It has a plugin manager and a few basic plugins, plus also some comments in the config files that explain what some of these settings do. It is a nice way to get started with NeoVim, without being too overwhelmed.

Note: The associated YouTube video for setting out the Kickstart is outdated, which you see if you read the complete text, and not look at that right away after reading a few lines of the description, like I did.

I can definitely recommend starting there. You will still be confused, since there is not one plugin manager for NeoVim and Vim, but many of them, and they have slightly different syntax and capabilities.

But it is a great way to get started.

Terminal rabbits

My preference in themes for editing are light themes, not the dark themes. Nowadays, that seems to that I am the odd one, there are more dark themes and many theme examples default to dark theme, including NeoVim.

A lot of my initial efforts were to get a nice light theme working with NeoVim, which turned out to be easier said than done.

Part of that had to do with the default terminal application in macOS, which leaves a bit to be desired with color schemes when your editor is running inside the terminal itself.

When I realized that the macOS terminal app was part of the problem, I searched for other terminal applications that would suite better.

I ended up with Wezterm, which is a very nice terminal emulator. It has better support for color schemes than the macOS terminal app, and it is also configurable using Lua, which I think was a nice bonus.

I sorted out that part of the setup by making a few configuration changes for WezTerm, and WezTerm, along with the light theme settings I used, worked well.

Now, shelling out to the Terminal is something you can do in NeoVim in multiple ways, and it worked great for many commands. However, in some other cases, it was not sufficient.

Since many people seem to use a terminal multiplexer like tmux, I tried that out.

I found this YouTube video quite good for setting up tmux with NeoVim:

The Zen tmux config

Note: I saw later that WezTerm has built-in support for terminal multiplexing, similar to tmux.

I have not tried it out yet, but I will eventually do it.

In the meantime, you can read the multiplexing docs here.

Summary

Even though I have had some struggles with the setup, and the occasional WTF moment, overall I am quite happy with my setup. I could go into a more detail on the setup of NeoVim itself, but I think that is better to leave for another post.

I am still learning every day and getting better with NeoVim and the setup I use now. At the moment, I am roughly on par with my VS Code productivity, depending on what I work with.

Some things are definitely better/faster, other things have room for improvement.

I can recommend to not do too much at the same time. You can start gently with a Vim mode plugin for your current editor, and learn to use some motions commands.

After that you can set up NeoVim, and add a few plugins. Do not add too much at the same time. You will only get overwhelmed.

I am definitely enjoying my editing experience, and I know it will get better with time.

I hope you will too!

Back to top