theodcr

👨‍💻 My keyboard-driven working environment

Published on 5 June 2020

Updated on 4 June 2023

Note: As of 2023 my setup has changed a bit but follows a similar workflow: I replaced Regolith by XFCE which is lighter, more robust, and allows stacking windows more easily; I mostly use the Helix editor now, which is similar to Neovim but better follows my “gets the job done well without requiring too much tinkering” philosophy; and I adopted Markdown for all my notes and documentation, the migration from vimwiki was a breeze.

In this post I detail how I use my computer every day at work. I am a Python developer and data scientist. I like tools that get the job done well without requiring too much tinkering, and I try to use the keyboard as much as possible, I like the speed and precision of typing. I currently work on Linux, but I have previously used this workflow of MacOS, and most software presented below is available for Windows too (I use Windows at home for some other specific software).

Desktop: Regolith

I use Ubuntu with the Regolith desktop environment, which is in summary GNOME + i3. I recommend it to anyone looking for a keyboard-driven desktop environment that is easy to install and configure.

I map the Caps Lock key to Escape, as I use this key much more often, notably for Vim.

Editor: Neovim

I learnt Vim during my first development internship in 2015, while writing numerical simulation code in Fortran. I first used gedit which comes with Ubuntu and is very good, but I wanted to avoid having to move my hand to the arrow keys on the right of the keyword. Vim gave me that and much more, it didn’t take long to convince me. I since moved to Python as my main language, and after trying Emacs, VSCode and PyCharm multiple times, I keep coming back to Vim. No other editor seems as snappy, complete and customizable. VSCode is slow, PyCharm eats my machine, Emacs crashes, but Vim works. I haven’t found another editor that can record macros, use regex for search and replace, store text in multiple registers, or repeat the last action with one key. These are basic Vim features (okay Emacs certainly has these features too). Vim also has a very low typing latency I have never seen anywhere else. While Vim-like workflows in other editors are noble efforts, none delivers all of its advanced features or offers a comparable flexibility. Generally, Vim makes me feel like it follows my will, not the other way around. I also appreciate being close to the terminal.

Note: I had a very enjoyable experience with Doom Emacs, the light Emacs distribution suited for Vim users. It felt feature-full, fast enough and more clever than Spacemacs. However I gave up because of the crashes (however rare) and various Emacs quirks causing some discomfort.

I switched to Neovim in 2018 for its newer features, active ecosystem and generally more stable and pleasant experience. I don’t use many plugins, but they greatly enhance my workflow:

Terminal: kitty + fish

I like to live in the terminal, the keyboard interface par excellence. My main terminal application is kitty, it is easy to install, easy to configure, efficient and stable. It provides all the features I need: beautiful font rendering, panes, tabs, simple sessions, and powerful keyboard shortcuts. I use it like a bare-bones tmux, with a predefined ready-to-use session config that creates tabs and panes for my projects.

I have used bash for a long time and still do, but my main shell is fish now. My choice was driven by the same motivations as my other tools: easy to install and configure, very practical and useful out of the box. Its auto-completion and syntax highlighting are probably its best selling points. It is simply very comfortable to use as my main command-line driver. And as for general efficiency in the terminal, a handful of bash and fish aliases goes a long way.

Notes and knowledge base: vimwiki and pandoc

One thing that definitely helps me in my work every day is my personal knowledge base. It began with a few markdown files and rapidly became a large wiki that I use and write with the vimwiki Vim plugin. The plugin mainly helps with the navigation between files, defining tags, tables of contents etc. I chose to use vimwiki’s own markup syntax, I find it light and pleasant (small example: I like that bold syntax only requires one character as opposed to two in Markdown), and better supported by the plugin (at the time). I don’t think I will bother moving my wiki back to Markdown or to another format soon, it is too big.

However, I tried to use Emacs Org mode several times to take notes and evaluate its usage for my knowledge base. It is renowned as the best tool for that among the Vim and Emacs communities. But I was just overwhelmed by its size and possibilities (and Emacs always ended up crashing or doing something unexpected, I probably wasn’t patient enough). Vimwiki + some mappings and shortcuts gives me all I need to maintain my knowledge base, some work-related notes, and my day-to-day work diary. I write what I do at work every day, it helps thinking through complex problems and it keeps records. It’s definitely another great help, but again I don’t need advanced Org mode features for that.

Pandoc works well for any conversion of my notes or knowledge base to HTML files (and for building this blog too). Adding a style sheet like water.css immediately creates beautiful pages.

Web: Firefox + Vimium

I went back to Firefox in 2017 with the release of their newer engine, and I haven’t looked back. It’s fast, and I much prefer their approach to web browsing. I use the Vimium plugin to navigate the web with vim-like key bindings. I tested several other plugins for this, I found Vimium to be the most straightforward.

Data science: classic Jupyter

I have a need for an interactive environment to prototype code and algorithms, explore data, and design visualizations. I have tried many solutions (Jupyter, VSCode, PyCharm, Vim and IPython etc) and still haven’t found the perfect one, that would be the topic of a whole other blog post.

I have used JupyterLab and its rather well-working vim keybindings plugin. I even wrote a gruvbox theme for it. But the heaviness and quirks of JupyterLab have lead me back to the classic Jupyter Notebook recently. It is the fastest, most stable and predictable notebook environment I have found. I don’t spend as much time in the notebooks as before, so I’m okay with something simple. I should look into its vim keybindings.