Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terminal Config Reference

A reference document for my terminal environment, shell workflow, aliases, plugins, key bindings, and custom utilities.

Preview

Terminal Preview Tmux Preview

Table of Contents

Overview

This terminal environment is built around:

  • Ghostty
  • tmux
  • Zsh
  • Oh My Zsh
  • Starship
  • eza
  • bat
  • fzf
  • zoxide
  • lazygit
  • btop
  • NVM (lazy-loaded)

Shell Functions

cdf

Fuzzy-search for a directory and change into it.

Usage

cdf

Type part of a directory name, select it with fzf, and press Enter.

mkcd

Create a directory and immediately enter it.

Usage

mkcd my-project

Equivalent to:

mkdir -p my-project && cd my-project

cs

Change into a directory and immediately list its contents.

Usage

cs [directory] [flags]

Any flags starting with - are passed directly to ls.

Examples

cs my-project        # cd into my-project and list contents
cs ..                # cd up and list contents
cs ~/dev -la         # cd into ~/dev and list with -la flags
cs -la               # list current directory with -la flags

Key Bindings

History Search

Ctrl + R

Fuzzy-search command history using fzf.

Workflow

  1. Press Ctrl + R
  2. Start typing
  3. Select a previous command
  4. Press Enter

Sudo Previous Command

Esc Esc

Provided by the Oh My Zsh sudo plugin.

Re-runs the previous command with sudo.

Example:

apt install docker

Press:

Esc Esc

Becomes:

sudo apt install docker

Plugins

plugins=(
  git
  z
  extract
  sudo
  web-search
  fzf
)

git

Provides Git aliases and shortcuts.

Examples:

gst
gco
gl
gp

z

Jump to frequently used directories.

Example:

z projects

extract

Extract many archive formats with a single command.

Example:

extract archive.zip
extract archive.tar.gz

sudo

Quickly prepend commands with sudo.

Supports:

Esc Esc

web-search

Search the web directly from the terminal.

Examples:

google nextjs middleware
duckduckgo golang concurrency

fzf

Provides fuzzy searching and history integration.

Examples:

Ctrl + R
cdf

Command Line Tools

eza

Modern replacement for ls.

Aliases

ls
ll
la
tree

Features

  • Icons
  • Git integration support
  • Better formatting
  • Improved readability

bat

Modern replacement for cat.

Alias

cat

Features

  • Syntax highlighting
  • Git integration
  • Line numbers

zoxide

Smarter directory navigation.

Examples

z backend
z nextjs
z automation

Jumps to frequently used directories.

lazygit

Terminal Git UI.

Alias

lg

btop

Modern system monitor.

Alias

top

Displays:

  • CPU usage
  • Memory usage
  • Disk activity
  • Network activity
  • Processes

Aliases

Git

Alias Command
gs git status
ga git add .
gc git commit -m
gco git checkout
gpl git pull

Directory Navigation

Alias Command
.. cd ..
... cd ../..
.... cd ../../..
~ cd ~

Tmux

Alias Command
ta tmux attach -t
tls tmux ls
td tmux detach
tk tmux kill-session
tn tmux new -s

Utilities

Alias Command
cat bat
top btop
grep rg
lg lazygit

Tmux

The terminal automatically launches tmux when opening a local shell including SSH sessions.

Session Management

Create a session:

tn backend

Attach to a session:

ta backend

List sessions:

tls

Starship Prompt

The shell prompt is powered by Starship.

Displays:

  • Current directory
  • Git branch
  • Git status
  • Node.js version
  • Command success/failure state

Command Highlighting

Powered by:

zsh-syntax-highlighting

Behavior:

  • Valid commands use the default terminal color
  • Invalid commands are highlighted in muted red
  • Paths are highlighted in blue
  • Quoted strings use default text coloring

Autosuggestions

Powered by:

zsh-autosuggestions

Behavior:

  • Shows suggestions based on command history
  • Suggestions appear in muted gray
  • Accept suggestions with the right arrow key

NVM

Node Version Manager is configured with lazy loading.

NVM is only loaded when one of the following commands is first used:

node
npm
npx
nvm

This improves shell startup time.

History Configuration

History is shared across terminal sessions.

Enabled features:

  • Shared history
  • Duplicate removal
  • Duplicate expiration
  • Ignore commands beginning with a space

History limits:

HISTSIZE  = 10000
SAVEHIST  = 10000

Common Commands

Command Description
pwd Print current directory
cd Change directory
touch file Create file
mkdir dir Create directory
rm file Remove file
cp src dest Copy file
mv src dest Move file
cat file View file with bat
top Open btop
lg Open lazygit
ll Detailed file listing
tree Tree view of directories

Terminal Philosophy

This environment prioritizes:

  • Fast startup
  • Keyboard-first workflow
  • Minimal visual clutter
  • Modern CLI tooling
  • Consistent aesthetics
  • Efficient project navigation
  • tmux-centered development

About

the final form of procrastination

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages