Ultimate Guide to Linux 10x Developer Setup
šŸ§

Ultimate Guide to Linux 10x Developer Setup

Tags
Linux
Tech
Tools
Terminal
Published
February 19, 2023

TLDR

Use Shell and shell-based applications over GUI apps.
Tools that I use, that accelerated my productivity:
  • bat: better cat with row numbers and syntax highlighting
  • exa: better ls replacement
  • fzf: find any file or directory with āš”ļøspeed
  • Zshell (Oh-my-zsh): improved shell interpreter
  • Tmux: split your terminal window in tiles
  • Albert: spotlight-like launcher, but better
Ā 
šŸ’”
This list will definitely change and content will be optimized in the future, so it would be wise to bookmark it.

Concerning Linux

For me the experience with Linux the first time around (~ 2017) proved a laborious experience. Tooling worked, environment looked prettier than Windows but the cost of maintenance was too high. Reliability was also a huge pain point, experiencing frequent crashes likely stemming from poor choice of installed drivers. At the time of first publication of this article in 2023 I am delighted to say that Linux has improved in every way that made me resent it. In short, itā€™s awesome again. This guide shows the choice of my tools that accelerate my workflow and developer productivity. The best thing is itā€™s portability as it can be applied to any UNIX system. Is this the last workflow I will ever need?

Devsā€™ dirty secret šŸš

For anyone who uses primarily GUI applications, I might have some surprising news for you.
Your tools are most likely just a graphical wrappers, a.k.a. Graphical User Interface (GUI) on top of compiled command line (CLI) applications or background services.
And even though itā€™s really not that bad (in most cases), GUI is responsible for eating up a lot of your RAM and GPU. I would have to go as far as to say, it is what slows you and your machine down.
Why is that? Well compare how expensive it is to render pixels of the layout on their respective position in some separate process, considering resolution of your display with just displaying text in one font in the command line. Additionally, with GUI you get the information you desire and a ton of potentially distracting decorative elements. A bad ink to data ratio. You get the idea. You might argue that CLI apps are on the opposite end of the spectrum and you would be right. You will get just the textual information you need, perhaps differentiated by color. But remember we are here to be productive, not to marvel at the beautiful scenery. Thatā€™s why I believe that the following is true for any serious developer:
Sooner or later every software programmer will move majority of their workflow to the terminal.
Donā€™t get me wrong, I love sleek and beautiful UI that is joy to use. Although we should always favor functionality and intuitiveness before the pretty, Iā€™ve been guilty of it myself. I spent countless hours trying to perfect the round border, apply the intricate shadow and optimize the smooth transition. Iā€™ve been building UIs for a long time now and I tend to always fall into this time trap. And yet, I turn my opinions about UI completely around when it comes to productivity tools. When it comes to building stuff, I donā€™t aim for ā€œuglyā€ tools, I am for ā€œgets the job done the way I want itā€ tools and I am for the highest data-to-ink ratio. However, this does not mean that it needs to be a boring and unappealing experience. As luck would have it, most of the tools I use have some limited option to customize the theme.

Terminal benefits summarized

In any case, the following can be used as a rule of thumb:
āŒØļø
Unless written badly, Terminal applications will be always faster than their GUI rivals
Several implications follow from this.
  1. Using exclusively CLI apps may breath a new life to otherwise dated hardware.
  1. You can transfer your workflow and setup the same environment on every major operating system
  1. With programming tools you often have no other alternative.
  1. CLI tools tend to startup a lot faster than GUI apps
  1. CLI apps almost always adhere to UNIX conventions, so learning how to interact with one app opens doors for all others
  1. Itā€™s how our grandad programming wizards have done everything (there was no alternative)
  1. You look like an ultimate hacker to your less tech savy friends

A word of encouragement

Lastly, if you are like me, itā€™s fair to say that operating in the terminal environment for the first time feels foreign. It is hard and intimidating. But donā€™t despair. Look at it as a journey. It wonā€™t feel or necessarily be productive the first time around (perhaps not even the fifth time). But trust me, you are learning a valuable skill that will stand a test of time (very rare in tech industry). Feeling comfortable in the terminal will pay itself off several times over.

What tools I use

You have probably glanced over TLDR at the beginning so you might already have an idea of whatā€™s coming. Let me begin with some time-tested Linux tools and then the actual environments.
It is fair to say that the tools I will discuss represent by no means a definite list of every single tool I use in terminal, though they definitely account for over 80 %. Beyond the classic tools like cd, pwd, grep, find, ssh, git and others, I use some lesser known upgraded alternatives to classical tools such as bat (batcat on Ubuntu) exa and fzf. Also forgetting curve mandates that I donā€™t remember most of the commands, so I use cheat as my go to resource for quick refresh.
The Following table summarizes listed alternatives to popular Linux tools.
Original
Alternative
Alternative Advantage
cat
bat
syntax highlighting, line numbers, git integration
ls
exa
smarter colors, tree integration, git integration, headers and more
grep find cd
fzf
fast customizable fuzzy finder for searching directories and files, can be configured to change directories and preview files
man
cheat
Quick and straightforward community backed interactive cheatsheet for frequently used commands
Configuration to get up to speed with the tooling can take a while. Luckily I did it so you donā€™t have to (see below). I personally configured these programs to act as if they were the originals. Note that in Ubuntu you need to use batcat instead of bat .
Instead of commands, you can use shortcuts to search for file or directory with fzf. I modified the defaults in the following way:
  • Ctrl+t : search for files, preview their contents using space
  • alt + c : search directories and cd to them, show directoryā€™s tree structure using space
In Ubuntu, however, you need to enable keybindings first.
Should you choose to use those tools with the same experience as I have, paste the configuration below to your config file (something like ~/.bashrc , ~/.zshrc etc.).
# use like regular cat and ls alias cat='batcat --paging=never' alias l='exa -lag --header' alias ls='exa' # FZF # Enable Key Bindings . /usr/share/doc/fzf/examples/key-bindings.zsh # CTRL+T searches for files preview files with space export FZF_CTRL_T_OPTS='--preview "batcat --style numbers --color=always {}" --bind="space:toggle-preview" --preview-window=:hidden' # ALT+C searches for directories to change into, preview directory tree structure with space export FZF_ALT_C_OPTS='--preview="exa --tree --level 1 {}" --bind="space:toggle-preview" --preview-window=:hidden'
.zshrc

Zshell

Default Bash Terminal interpreter is powerful. But Zshell (Zsh) is a hot contender for a replacement. It appears so much better in fact, that Apple ships Macs with Zsh by default. I personally manage Zsh configuration using Oh My Zsh framework which does a lot of configuration for you. The first thing you notice is that it has much prettier coat. Discover different themes or configure your own. I use Bira Theme.
Zsh Bira theme
Zsh Bira theme
Oh My Zsh provides a wide range of utility plugins that can streamline your workflow. I use git, nvm (node version manager), syntax highlighting and zsh-autosuggestion that come in handy when I donā€™t want to retype frequently used commands. Here is the configuration:
# differentiate autosuggestions ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#5f5f5f,underline" # configure plugins plugins=(git nvm zsh-syntax-highlighting zsh-autosuggestions)
.zshrc
The configuration can be easily changed by editing ~/.zshrc file.

Tmux

Sole terminal window is for rookies. We need to manage our terminal somehow.
Tmux is a terminal app for splitting your terminal into multiple juxtaposed (side-by-side) parts. The name terminal multiplexer suggest that the terminal can enable your terminal to consists of multiple parts. It has countless benefits for efficient management of your terminals. Long story short, this concept is the same as the vertical and horizontal tiling of apps. Imagine for example splitting screen where left half is used by browser and the right part is used for running a video. Now just bring your mental model to the terminal.
There are couple of terms to keep in kind:
  • Session : an instance of Tmux and a wrapper for multiple windows
  • Window : single window that can have multiple panes
  • Pane : a single area to which window can be split (either vertically or horizontally)
To bring this one home I sketched out a diagram that explains mentioned concepts visually:
Example of splitting a Tmux session
Example of splitting a Tmux session
Note that there can be multiple sessions running simultaneously among which you can quickly navigate. The same applies for windows. In the diagram there are 2 windows in the current session called zsh and mc.
Below is example of what the real thing can look like.
Screen shot of Tmux running multiple terminals in a single window
Screen shot of Tmux running multiple terminals in a single window
Configuration file of the Tmux can be generally found in ~/.tmux.conf . There are several configurations through which I initialize several plugins, notably Dracula Theme, for continuous saving of the session and for loading of session settings. Feel free to copy to achieve the same look and feel.
# List of plugins set -g @plugin 'dracula/tmux' set -g @dracula-ram-usage-label "RAM" set -g @dracula-military-time true set -g @dracula-plugins "network cpu-usage ram-usage battery time" set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' # Set 256 colors set -s default-terminal 'tmux-256color' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-continuum' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' # Rebind prefix unbind C-b set-option -g prefix M-w bind-key M-w send-prefix # set VI commands in copy mode setw -g mode-keys vi
.tmux.conf
Note that for installing of the tmux plugins I use Tmux Plugin Manager (tpm). When you install this plugin manager, in the tmux running session run tmux source ~/.tmux.conf and prefix +I to install all the plugins.
When you install and run Tmux it for the first time, it will be hard to tell that anything is really going on. Tmux is controlled using keyboard shortcuts. It was definitely a struggle for a while to get accustomed to the shortcuts. But once you get a couple under your belt, you can never go back to regular terminal. Let me list just a couple to get you started:
Description
Shortcut
Note
prefix
Ctrl + b
this lets tmux know you want to manage tmux and not the current terminal)
split into 2 vertical panes
prefix + "
splits current pane into 2 vertical panes
split into 2 horizontal panes
prefix + %
splits current pane into 2 horizontal panes
change active pane
prefix + o
considering you have multiple panes in the window
change active window
prefix + n
considering, you have created multiple windows
New Window
prefix + c
creates current window
Close pane
prefix + x
kills current pane
Close Window
prefix + &
kills current window
Detach Session
prefix + d
closes tmux session (back to regular terminal)
These alone will get you far, but there are many more options. I tend to reach out to the wonderful cheat sheet below.
Last important thing to bear in mind about Tmux is that it works in 3 modes:
  • Normal Mode: mode in which you can use shortcuts as described above
  • Command Mode: enable using prefix+: and type commands
  • Copy Mode: enable using prefix + [ and scroll through the contents of current pane
šŸ”„
Pro tip: If you want to navigate through the output of the pane using VIM commands, you can do that by entering command mode and typing setw -g mode-keys vi. Afterwards simply VIM motions or / to search for specific word. This is part of the mentioned .tmux.config if you have used it, you are all set.

VIM (VS Code VIM)

The first time you enter VIM editor, you probably wonā€™t be able to exit it. Although I am not as advanced to completely switch into VIM editor (or rather NeoVIM), learning VIM moves was likely the most rewarding experience in programming so far. Most editors support emulation of VIM motions for editing. And that is exactly what I do. I use VS Code VIM extension ( vscodevim.vim) to do the trick.
Why would you do that? The answer is unparalleled speed and efficiency. Change arbitrary contents in couple of key presses and navigate a file like a true pro. Whatever you can do in normal editor, you can do it much faster in VIM. The idea is to keep your hands on the keyboard at all times (on the row of keys a-l). From there you can delete, change and move in myriad of different combinations. Itā€™s important to keep in mind that VIM operates in 3 modes:
  • Normal : for navigation, does not change anything
  • Insert : enables you to type (enter using i as insert, a as append, or c as change something)
  • visual : enable using v , you can select pieces of text
There is much more to using VIM. I canā€™t do really do it any justice, so I recommend watching a video series explaining the unrivaled power of VIM motions. Note that this will take time to get used to and will require certain amount of grit on your part. The payoff, however, is truly astronomical.
Video preview
Again there are couple of configs that I set for VIM extension to fit my needs. First and foremost, I donā€™t want to give up my regular Ctrl shortcuts (copying, cutting, pasting etc.), therefore I disable VIM behavior. I also recommend enabling , which enables you to jump anywhere on the visible screen instantly. When enabled, it works by pressing <leader> character twice (\ by default) and s and first letter of a word on which you want to jump on with the cursor. All viable words are then highlighted with a letter to press in order to make the jump. Itā€™s not really as difficult as it sounds. It will become clear immediately after watching the demo on the projectā€™s GitHub page. The problem is that pressing the outlined combination gets tiresome fast. I therefore introduced a remap, that enables to use vim easy motion just by pressing <leader>.
Below I show settings.json with all VIM extension configurations that I use.
{ "vim.handleKeys": { "<C-w>": false, "<C-x>": false, "<C-f>": false, "<C-c>": false, "<C-v>": false }, "vim.normalModeKeyBindings": [ { "before": ["<C-u>"], "after": ["<C-u>", "z", "z"] }, { "before": ["<C-d>"], "after": ["<C-d>", "z", "z"] }, { "before": ["<leader>"], "after": ["<leader>", "<leader>", "s"] } ], "vim.easymotion": true, }
settings.json

Midnight Commander (MC)

Although FZF takes care of most of my file-searching and directory-changing use cases, my workflow have always involved a 2 panel file explorer. For Windows the golden standard has always been Total Commander, Linux alternative is Double Commander. Their granddad which is a still actively developed, the Midnight Commander (mc), can do everything they do for a fraction of resources. Coming to mc from the mentioned GUI alternatives, I have a feeling that those have been largely inspired by the control mechanics of mc. In other words, if you know how to control one, you will automatically pick up controls of the other. Beyond the obvious functions, mc has a built in editor, file viewer, ssh, directory hot list, quick cd and many more. Oh and have I mentioned you can use mouse? If you are curious about the theme, I use Dracula Theme in my configuration.
Midnight Commander with Dracula Theme
Midnight Commander with Dracula Theme
There are many shortcuts to control mc. UI (particularly the bottom bar) helps with most of the action shortcuts. When accessing any dialog, letters on action buttons tend to be highlighted suggesting that given letter corresponds to the action. E.g. when clicking on Options, the Layout item has letter L highlighted. Pressing L navigates to Layout. Let me again give you handful of the less obvious ones that I most frequently use.
Description
Shortcut
synchronize panels to have the same directories
Alt + i
Switch to command Line (and back)
Ctrl + o
Directory hotlist dialog
Ctrl + \
Quick cd dialog
Alt + c
Execute Prefix (exe)
Ctrl + x
File/Directory Information in the next pane
exe + i
File/Directory Quick Preview
exe + q
Navigate to directory 1 level up
Ctrl + page up
Open Search Dialog
Alt + ?
šŸ”„
Pro tip: When in directory start typing for the file or directory and it will be automatically selected.

Albert

Although this tool is not based in terminal, I have benefited from it so much, that I had to include it on the list.
One thing that I always envied Macs was the built-in launcher, Spotlight. On Windows I enjoyed using customizable Keypirinha. On Linux the best launcher is without any doubts Albert (granted, naming seems suspiciously inspired by Alfred for Mac). Albert is performant and extensible launcher that can do it all:
  • quick maths
  • search google/duck duck go/bing/YouTube/MDN/ChatGPT ā€¦
  • quickly launch URLs with specified query string arguments
  • search through firefox/chromium bookmarks
Example of Albert launcher
Example of Albert launcher
The theme I use is called Numix Rounded. I have set the launching shortcut as alt + space. This may be problematic in some applications and especially in Ubuntu. To make sure you can launch Albert everywhere, every time you need to create a custom shortcut.
In Ubuntu navigate to settings ā†’ keyboard ā†’custom shortcuts and create a new shortcut. Set it to your desired shortcut and assign albert show as a command.
The most useful use case for me is quickly launching bookmarks and specific websites such as dictionaries, documentations and other frequently launched websites with desired queries. You would not believe how much friction this approach takes away.
Ā 
Ā 

Picture of Hynek Zemanec

Written by Hynek Zemanec who lives and works in Vienna, Austria, building beautiful things. Follow him on Twitter and check out his Photography adventures