Written by
Maximilian Leodolter
Create the right environment to be a CLI poweruser.
Table of Contents
For macOS users, creating a minimalistic yet powerful CLI environment is easier than you might think. Let’s dive into how you can set up your macOS to become a CLI poweruser.
A minimalistic CLI setup focuses on simplicity, efficiency, and performance. By stripping away unnecessary bloat and optimizing your tools, you can achieve a cleaner, faster, and more intuitive command-line experience. This approach not only enhances productivity but also reduces distractions, allowing you to focus on what’s important.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
With Homebrew installed, you can easily manage and install other CLI tools.
Download and install iTerm2 from iTerm2.com.
brew install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
brew install fzf
$(brew --prefix)/opt/fzf/install
brew install tmux
Themes: Choose a minimalistic theme like robbyrussell or agnoster. Plugins: Enable plugins that enhance productivity, such as git, z, and autojump. Edit your ~/.zshrc file to apply changes:
nano ~/.zshrc
Add or adjust the following lines:
ZSH_THEME="agnoster"
plugins=(git z autojump)
source $ZSH/oh-my-zsh.sh
Create a .tmux.conf file in your home directory to customize tmux:
nano ~/.tmux.conf
Add these basic configurations to get started:
# Enable mouse mode
set -g mouse on
# Set prefix key to Ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Split panes using | and -
bind | split-window -h
bind - split-window -v
# Reload tmux configuration
bind r source-file ~/.tmux.conf \; display "Reloaded!"
brew install bat
brew install exa
brew install ripgrep
Keyboard Shortcuts Learn and use keyboard shortcuts to navigate and manage your CLI environment more efficiently. For instance, in tmux, you can switch between panes and windows quickly with key bindings.
Aliases and Functions Define aliases and functions in your ~/.zshrc to speed up repetitive tasks. For example:
alias ll='ls -lah'
Setting up a minimalistic CLI environment on macOS can greatly enhance your productivity and streamline your workflow. By leveraging powerful tools like Homebrew, iTerm2, Zsh, and tmux, you can create a clean, efficient, and highly customizable command-line interface.
With the right configurations and a focus on simplicity, you can become a CLI poweruser, handling tasks more efficiently and effectively. So, take the plunge and optimize your macOS CLI setup today!