Once upon a time, I was a proud Ubuntu user. It was easy to install and easy to use. I was a Windows user before that:
Ubuntu was feeling similar.
Months after month, my pride decreased as much as my annoyance increased. Ubuntu was letting me down:
- Weird display bugs was popping from time to time.
- It was pretty slow.
- I had to compile manually a lot of applications not available in the official repositories.
- I had to compile manually a lot of applications totally outdated in the official repositories.
- I had to learn a lot of random shortcuts to use my keyboard as much as possible, for basically every tool.
I didn’t know better, so I stuck with it for years. One morning, fresh and motivated, I decided to upgrade my LTS version. Everything crashed. I couldn’t even start Ubuntu anymore. I tried to fix everything, but I had no clue about Linux at the time. Where to begin? What to do? The Ubuntu forums were not helpful, so I decided that it would take me less time reinstalling everything.
The bitterness filling my heart was unstoppable. Ubuntu, my old friend, let me down again, in a spectacular way.
Luckily enough, some months later, I had the pleasure to work with amazing developers who showed me how to build a very effective development environment.
My whole workflow shifted from there. I went from Ubuntu to Arch Linux, from Unity to i3, from PhpStorm to Neovim. After years of silent struggle, I finally had a scalable, stable, up-to-date, and very efficient system. I even wrote a bunch of scripts to install everything I need in one command line. Everything I needed to get things done was ready to serve my ambitions.
It was one of the best shift I did in my career. No more, no less. Why?
- I learned a ton about Linux thanks to
- It’s important to know how things work under the layers of abstraction of your OS, to be able to solve possible problems.
- Knowing about Linux is mandatory to me for any developer out there, since web servers are mainly running on a Linux based system.
- I have consistent shortcuts (keystrokes) throughout almost every tool I’m using.
- I can use 90% of my system with the keyboard only. If I can remember them, it’s because they make sense, much more than the typical GUI shortcuts, like
ctrl + shift + alt + e.
When I switched to the tools I use today, I really understood how important it is to have a good, efficient, and scalable development environment. I was feeling at home. It was finally a system which answers my needs, and not a system I was fighting against.
Developing became more enjoyable. Sorry, it’s an understatement: coding was 10 times more fun!
In this article we’ll speak about:
- Why the Linux shell is the best tool you have, as a developer.
- Why using Arch Linux.
- What is i3.
- How to have a powerful terminal with urxvt, tmux, and tmuxp.
- An editor where you can leverage the power of the Linux shell, giving you the most powerful IDE I’ve seen to date.
- Improving git in the terminal.
- A better experience with MySQL and PostgreSQL in the shell.
Interested? Come with me. I will introduce you to the fantastic world of a Mouseless Development Environment.
Your Best Friend, the Shell
Simple et efficient shell
The Power of Plain Text
You might wonder: why using a text-based shell?
- You have access to many applications. Even if you don’t have the very specific tool you need, you can develop it more easily for the shell; no need to design a GUI on top of it.
- It’s easier to give a lot of optional possibilities to the end user, letting him do exactly what he wants. You can’t put 20 buttons on a graphical interface? With a command line based application, you can have 20 options.
- The Unix philosophy allows you to use specific tool for a specific need. Using pipes to throw the output from one tool to the input of another give you endless possibilities.
- You can automate (boring) common tasks very easily using the shell. Automating is key to increase your productivity and saving your mental energy where you need it.
- Command lines are often really fast. No heavy graphical interfaces full of 3D menu and whatnot to slow down your computer.
- CLIs don’t usually take a lot of memory. This can save you when you modify 5 different microservices with Chrome eating 80% of your RAM.
Command-line tools can be 235x faster than your Hadoop cluster.
I encourage you to use the shell as much as possible. It can be a bit tough at first, but the benefits are insane.
What about graphical interfaces on top of CLI applications? To me, it has serious disadvantages:
- It can hide a lot of functionalities you would access easily with the CLI.
- You won’t be able to solve (or even understand) any bug coming from the CLI layer.
Things get confusing when you need to:
- Use the tool on a remote server without your graphical interface.
- Explain to a less experienced developer how the tool really work. You can explain the GUI, not really the application itself, especially if the terminology between the GUI and the CLI is different. It happens more often than not.
I have a real life example with
sourcetree, a graphical interface for git. I worked with a junior developer who was using it without knowing how
git was working. When problems popped up, it was difficult to know what command the GUI was calling under the hood. It was more frustrating than simply using the CLI
git in the shell.
A Mouseless Approach
With the shell, you use mainly your keyboard. It might surprise some of you, but I try to avoid my mouse as much as possible. This is one of most important advice about efficiency I can give: keeping your hands on your keyboard might make you faster, but, more importantly, it will make you happier.
Here are some advantages of the mouseless approach:
- Moving your hand from your keyboard to your mouse is tiring. You’ll feel it if you stop doing it.
- It’s more enjoyable to stay on your keyboard. You don’t have to switch constantly between typing and moving a pointer.
- You will feel like a hacker even if you only write your shopping list! How cool is that?
Arch Linux: Grab the Latest, Up-To-Date Software
Arch Linux running smoothly on a VM
Arch Linux has a lot of advantages compared to other Linux distribution.
A Rolling Release System
What the heck is a rolling release system? The Arch Linux community update constantly everything for us, the users, from the obscure tool you’re the only one using to the Linux kernel. When you install a new program, you can be sure you have its latest version.
No need to ask yourself if you miss great features and bug fixes for your favorite tools. You’ll have the most up to date system you can find.
What about the applications available? The official repositories of
Arch Linux are huge. You will find most of the time what you need there. If you don’t, you have access as well to the AUR (Arch User Repositories) where you can find everything else. I’m not exaggerating. After years using Arch Linux, the AUR still surprise me.
The only downside: the applications from the
AUR are not always well tested. Proceed with cautions. It’s easy enough to check their build to know what’s happening if you install them, however.
When you install
Arch Linux from scratch, you can choose exactly what application you want to install. Nothing you don’t want will pollute your hard disk. No useless applications will run in the background without your consent. You are the master of your destiny.
The community around Arch Linux is huge, too. They usually know what they are speaking about and don’t throw random shell commands on stack overflow without explanation whatsoever (I look at you, Ubuntu community).
Who needs stack overflow, anyway? The Arch Wiki is the best Linux wiki you can find. Again, this piece of art still surprise me today. There is everything in there.
Now, you might ask yourself: is
Arch Linux stable? Will it crash every two weeks, letting you alone and helpless?
You will find many people preaching exactly that on The Internet. My advice? Don’t listen to them. I use it on a daily basis for 5 years now. It never crashed, or very early, when I was playing with the installation process.
If you are careful with the
AUR, you can count on a very robust, lightweight, and customizable Linux distribution.
pacman (not the yellow cheese addict to pills, but Arch Linux Package Manager) will ask you to do some manual modifications. It’s always documented on the official website of Arch Linux and can be solved in no time.
Manage Your Windows With i3
Arch Linux doesn’t come with any type of desktop or windows manager. You’ll need to install your own. My choice without hesitations: i3 windows manager.
This is a very light, fast and simple-to-use windows manager. There are no fancy 3D effects with
i3. Everything is made for you to be efficient and productive, without being visually repulsive.
i3 you can create
workspaces. They take a whole screen and can be moved from one screen to another. In these
workspaces you can open one or multiple
windows. They will embed your favorite applications.
Simple, isn’t it? Now the best part: you can do everything with your keyboard easily. You can open, move and close
windows with simple keystrokes. You can resize
windows with other keystrokes. You can open your favorite application using keystrokes.
Everything feels logical. I was able to use
i3 efficiently two or three days after installing it the first time. Your muscle memory will work for you here to remember the keystrokes you need.
The configuration possibilities are huge. If you want to try it, I have an article which help you go through a basic i3 config, step by step. After that, you’ll understand i3 enough to customize it as much as you want.
Obviously the Arch Linux wiki has a good documentation about i3.
Urxvt, Tmux and Tmuxp: Your Terminal Is Now a Productivity Beast
Tmux in Urxvt with 4 panes open and two windows
It’s a very lightweight and fast terminal, especially if your run
Urxvt daemon. Spawning terminals everywhere becomes easy and painless.
sessions, which include
- Open as many
windowsin your terminal as you want. Each
windowtake the whole terminal window, and can be divided into
pane. You want 3
paneeach (for a total of 12 different shells open)?
tmuxcan handle that easily.
- Detach and attach your
session. Imagine that you close your terminal by mistake: you can recover your whole
sessionby opening a new terminal, and attaching your session.
- Synchronise your
pane. You need to run exactly the same command in three different remote servers? Open three
panes, synchronise them with one command, and everything you type in the first will be copied in the others.
- Many more things I don’t even know about yet.
Do I need to say that everything is manageable with your keyboard? You can use your mouse also, which is useful when you learn how to use it.
With tmuxp, you can even go further to automate your
tmux sessions. Indeed, you can write a configuration file to open the
panes you want, and automatically launching applications in them.
Let say that in order for you to work on your new cool project (which will make you rich) you need to:
docker composein a
npm run devinside one of your docker container in another
- Open a ssh connection to your production server in a different
tmuxp allows you to automate all of that with one command line and a simple configuration file.
I wrote another article about tmux which explains the basic configuration you need to get started. You’ll learn as well everything to customize it for your needs.
An IDE Which Fits You
This article was written in Neovim
Are you afraid? Don’t run away yet! Let me explain why you should really try to rethink everything you know about Vim.
I already write about Vim multiple time, so I’ll only summarize here why it’s great:
- Coding with Vim is fun.
- Vim let you leverage the power of your keyboard. Yep. Again.
- Vanilla Vim has a lot of functionalities. You always learn something new.
- You are not restricted to any language. You want to code in
Cwith the same editor, with autocompletion, syntax highlighting and all these good stuff? Vim is perfect for that.
- Everything is highly configurable. Forget bloated preferences; with Vim you can fine tune anything you want.
- No more notifications appearing out of nowhere to break your flow (I look at you, Intellij IDEs).
- Instead of having an IDE full of stuff you will never use, you can build your own only for your own workflow.
- It’s fast.
- It’s free.
Still suspicious? The best way to find out if I’m totally crazy is to try it. As you might expect, I wrote this article for this exact purpose.
Making Git Even Better: tig and diff-so-fancy
tig: on top the branch hierarchy, on the bottom you can see every change made
diff-so-fancy is very nice to see quickly everything you modified
git is very easy to use in the shell for the most common tasks we all do every day. The decisions made about the user experience are a bit weird sometimes, but it’s better to be aware of them from the beginning on.
Basically, you need on a daily basis to use:
Do you really need a whole GUI for that?
The first tool I use with Git is tig. It allows you to go through the hierarchy of git branches and display the details of each commit.
The second one is
git-so-fancy. It displays
git diff in a very readable way in your terminal. I always use it to verify what I did before doing a commit.
These tools are both available in the official
Arch Linux repositories.
Better CLI for MySQL and PostgreSQL
These tools are similar
PostgreSql CLIs, but on steroids:
- It auto complete databases, tables, joins, and so on.
- You can use snippets for the boring operations you do all the time.
In order to install them on
Arch Linux you’ll need to fetch them from the
Do I surprise you if I tell you that I wrote a whole article how to install and use efficiently mycli?
Are You Ready To Be A Mouseless Developer?
Productivity, versatility, efficiency, control, and comfort: they are the main reasons why I’ve chosen to build and configure my entire development environment. A couple of months ago (June 2020), I decided to write a whole book explaining step by step how to build a mouseless development environment. It changed my life, as a developer, and I would love to pass on the knowledge I’ve got from this experience.
Don’t listen to people who never tried
Vim saying that it’s the most complicated thing on Earth. Don’t listen to them arguing that
Arch Linux will crash even more than Windows 95. I used both intensively; I’m sure they didn’t.
This kind of environment asks for a bit of time and efforts to setup and understand. A couple of weeks. Then, you’ll have your own development environment, tailored for your present and future needs. You’ll feel in control. You’ll feel at home.