Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ghostty Terminal Configuration

This repository contains my custom configuration for the Ghostty terminal, including integration with Atuin for command history, Yazi as a file manager, and Mole for Mac cleaning and optimization.

Preview

ghostty

Ghostty Terminal in Action

The terminal configured with the Catppuccin Mocha theme, JetBrains Mono Nerd Font, and transparency/blur for a modern look.

Atuin - Smart Command History

Atuin

Atuin lets you search and navigate through command history efficiently, with semantic search and execution statistics.

Yazi - File Manager

Yazi

Yazi offers a modern file browsing experience directly in the terminal, with preview and intuitive navigation.

Mole - Mac Cleaning and Optimization

Mole is a CLI tool to deep clean and optimize your Mac, featuring system cleanup, smart app uninstalling, disk space analysis, live system monitoring, and project artifact cleanup.

Dropdown Terminal (Cmd+Esc)

Dropdown Terminal

Global shortcut Cmd+Esc to quickly open/close the terminal from any application.

Installation

Prerequisites

  • macOS (tested on macOS Sonoma/Ventura)
  • Homebrew installed
  • Git installed

1. Install Ghostty

brew install --cask ghostty

2. Install Zsh and Oh My Zsh

Install Zsh

Zsh usually comes pre-installed on macOS. To verify:

zsh --version

If it's not installed or you want to update:

brew install zsh

Install Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

3. Install Powerlevel10k (Theme)

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Then add to your ~/.zshrc:

source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme

4. Install Zsh Plugins

zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

zsh-history-substring-search

git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search

Other plugins

The z, sudo, web-search, and copypath plugins are already included with Oh My Zsh.

5. Configure .zshrc

Copy the contents of the provided .zshrc file or add the following configuration:

plugins=(
  z
  sudo
  zsh-syntax-highlighting
  web-search
  copypath
  zsh-autosuggestions
  zsh-history-substring-search
)

export ZSH="$HOME/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh
source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme

# Bind keyboard shortcuts for zsh-history-substring-search
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down

6. Install and Configure Atuin

Installation

brew install atuin

It can also be installed with the following command, as described in the Atuin documentation:

curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh

.zshrc Configuration

Add to the end of your ~/.zshrc:

. "$HOME/.atuin/bin/env"
eval "$(atuin init zsh)"

Sync (Optional)

To sync your history across devices:

atuin register -u <your-username>
atuin login -u <your-username>

And to sync your history with previously executed commands:

atuin import auto

7. Install and Configure Yazi

Installation

1. Update brew:

brew update

2. Install dependencies:

brew install yazi ffmpeg sevenzip jq poppler fd ripgrep fzf zoxide resvg imagemagick font-symbols-only-nerd-font

3. Install Yazi:

brew install yazi

Custom Function in .zshrc

Add this function to your ~/.zshrc to allow Yazi to change the current directory after closing:

function y() {
	local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
	yazi "$@" --cwd-file="$tmp"
	if cwd="$(cat "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
		builtin cd -- "$cwd"
	fi
	rm -f "$tmp"
}

How it works:

  • Creates a temporary file to store the current directory
  • Opens Yazi with the temporary file as a reference
  • When you close Yazi, it saves the selected directory to the temporary file
  • The function reads that file and changes to the selected directory
  • Removes the temporary file after use

Usage:

y          # Opens Yazi in the current directory
y /path    # Opens Yazi in a specific directory

8. Install Mole

image-mole

Mole is a CLI tool for deep cleaning and optimizing your Mac.

brew install mole

It can also be installed via the install script:

curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash

Key features:

  • Deep system cleanup (caches, logs, browser data)
  • Smart app uninstaller with thorough removal of associated files
  • System optimization (rebuilds databases, clears caches, refreshes services)
  • Disk space analysis and large file identification
  • Live system monitoring (CPU, memory, disk, network)
  • Project artifact cleanup (node_modules, target, venv, etc.)

Usage:

mole

9. Configure Ghostty

Copy the config file to the Ghostty configuration directory:

mkdir -p "$HOME/Library/Application Support/com.mitchellh.ghostty"
cp config "$HOME/Library/Application Support/com.mitchellh.ghostty/config"

Or clone this repository and create a symlink:

git clone <your-repository> ~/.config/ghostty
ln -s ~/.config/ghostty/config "$HOME/Library/Application Support/com.mitchellh.ghostty/config"

10. Install Nerd Fonts

The theme requires a Nerd Font. Install JetBrains Mono Nerd Font:

brew install --cask font-jetbrains-mono-nerd-font

Keyboard Shortcuts

Ghostty Global Shortcuts

Shortcut Action
Cmd + Esc Opens/closes the dropdown terminal (quick terminal)

Ghostty Terminal Shortcuts

Split Screen (Splits)

Shortcut Action
Super + D Creates a vertical split (right)
Super + Shift + D Creates a horizontal split (bottom)
Super + Ctrl + H Moves to the left split
Super + Ctrl + L Moves to the right split
Super + Ctrl + K Moves to the split above
Super + Ctrl + J Moves to the split below

Tab Management

Shortcut Action
Super + T Creates a new tab
Super + W Closes the current surface (split/tab)
Super + Alt + Right Arrow Next tab
Super + Alt + Left Arrow Previous tab

Utilities

Shortcut Action
Super + R Reloads the configuration
Super + Ctrl + F Toggles fullscreen

Note: Super refers to the Cmd key on macOS.

Zsh Shortcuts (History)

Shortcut Action
Up Arrow Search history (substring search)
Down Arrow Reverse history search

Atuin Shortcuts

Shortcut Action
Ctrl + R Opens Atuin for history search
Esc Closes Atuin
Tab Edits the selected command
Enter Executes the selected command
Ctrl + O Inspects the history

macOS Update Script

The repository includes a useful script to update the system and Homebrew packages.

Script Installation

  1. Make sure the script is executable:
chmod +x /Users/balvesdematos/Documents/script/update_mac.sh
  1. The alias is already configured in .zshrc:
alias update="/Users/balvesdematos/Documents/script/update_mac.sh"

Usage

Simply run:

update

The script will:

  • Check for Homebrew updates
  • Check for macOS updates
  • Ask if you want to install the updates
  • Run the updates according to your choice

Customization

Theme

The current theme is Catppuccin Mocha. To change it, edit the following line in the config file:

theme = Catppuccin Mocha

Other available themes can be found in the Ghostty documentation.

Font

The default font is JetBrains Mono Nerd Font. To change it:

font-family = "Your Nerd Font"
font-size = 25

Transparency and Blur

Adjust opacity and blur in the config file:

background-opacity = 0.8  # 0.0 (transparent) to 1.0 (opaque)
background-blur = 90       # Blur intensity

Troubleshooting

The terminal doesn't open with Cmd+Esc

Make sure Ghostty has accessibility permissions:

  1. Go to System Settings > Privacy & Security > Accessibility
  2. Add Ghostty to the list of allowed applications

Atuin is not working

Check that Atuin is installed and initialized:

atuin --version
atuin info

If necessary, reinitialize the shell:

exec zsh

Yazi doesn't change the directory

Make sure the y() function is in your .zshrc and that you're using y instead of yazi directly.

Zsh plugins aren't working

Check that the plugins are installed in the correct directories:

ls ~/.oh-my-zsh/custom/plugins/

And make sure they're listed in the plugins array in .zshrc.

Additional Resources

License

This repository contains only personal configurations. Feel free to use and adapt them to your needs.

Contributing

Suggestions and improvements are welcome! Feel free to open an issue or pull request.

About

Custom Ghostty terminal configuration for macOS, including the Catppuccin Mocha theme, Atuin integration for smart command history, and Yazi as a modern file manager. Also includes Zsh, Oh My Zsh, Powerlevel10k, and essential plugin configurations.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages