Skip to content
/ ghostinnu Public

Ghostinnu: Ghostty terminal running Nushell with Starship prompt

License

Notifications You must be signed in to change notification settings

arvi/ghostinnu

Repository files navigation

Ghostty, Nushell, & Starship Configuration

Configuration for Ghostty terminal, Nushell shell, and Starship prompt.

πŸš€ Features

  • Nushell: Modern shell with structured data pipelines
  • Ghostty: Fast, native, feature-rich terminal emulator
  • Starship: Minimal, blazing-fast, customizable prompt
  • CLI Tools: bat, fd, fzf, ripgrep, zoxide integration
  • Interactive Navigation: FZF-powered file/directory browsing with previews
  • Aliases: Organized by category (defaults, git, docker)
  • Keybindings: Efficient keyboard shortcuts for common tasks
  • Clean Structure: Modular configuration files for easy maintenance
  • Catppuccin Mocha Theme: My favorite color scheme

πŸ“‹ Prerequisites

Install these tools for full functionality:

# Core tools (required)
brew install nushell ghostty starship

# CLI tools
brew install bat fd fzf ripgrep zoxide

# Development Tools (optional; highly recommended)
brew install mise git-delta lazygit

# Editors - Neovim and Cursor
brew install neovim
# also install Cursor from https://cursor.sh

πŸ“ File Structure

~/Library/Application Support/nushell/  (this repository)
β”œβ”€β”€ README.md              # This file
β”œβ”€β”€ .gitignore             # Git ignore patterns
β”‚
β”œβ”€β”€ config.nu              # Main Nushell config
β”œβ”€β”€ env.nu                 # Environment variables
β”œβ”€β”€ aliases_defaults.nu    # CLI tool aliases
β”œβ”€β”€ aliases_git.nu         # Git-related aliases
β”œβ”€β”€ aliases_docker.nu      # Docker-related aliases
β”œβ”€β”€ navigation.nu          # FZF functions & keybindings
β”œβ”€β”€ integrations.nu        # External tool loader
β”œβ”€β”€ integrations_setup.sh  # Executable; auto-generates integrations directory
β”‚
β”œβ”€β”€ integrations/          # Auto-generated (gitignored)
β”‚   β”œβ”€β”€ starship.nu        # Generated by: starship init nu
β”‚   β”œβ”€β”€ zoxide.nu          # Generated by: zoxide init nushell
β”‚   └── mise.nu            # Generated by: mise activate nu
β”‚
β”œβ”€β”€ ghostty/
β”‚   └── config             # Ghostty terminal config
β”‚
└── starship/
    β”œβ”€β”€ starship.toml      # Full Starship config (symlinked to ~/.config/)
    └── starship.toml.minimal  # Minimal Starship config (symlinked as starship.toml to ~/.config/)

Note: On Linux, this would be ~/.config/nushell/. Configs use $nu.default-config-dir which works on all platforms.

πŸ”§ Installation - macOS

🍎 Primary Platform: These instructions are for macOS where this config is actively used and tested. While the Nushell configs themselves are cross-platform, the setup script may need adjustments for Linux/Windows. Contributions for other platforms are very welcome!

The following steps should be done in a bash/zsh shell using any terminal other than Ghostty.

Note: Ghostty will be configured in Step 3. For now, use Terminal.app, iTerm2, or another terminal emulator.

1. Backup existing configuration (Proceed to Step 2 if not existing)

# View config and back it up
ls ~/Library/Application\ Support/nushell
mv ~/Library/Application\ Support/nushell ~/Library/Application\ Support/nushell.backup

# You should see both nushell and nushell.backup
ls ~/Library/Application Support/

# Stop existing nu processes (if any) and delete nushell
killall nu
cd ~/Library/Application\ Support/
rm -rf nushell # try sudo rm -rf nushell if permission denied

2. Clone this repository

<repo-url> e.g https://github.com/arvi/ghostinnu.git

git clone <repo-url> ~/Library/Application Support/nushell
cd ~/Library/Application Support/nushell
ls -la

3. Run integrations setup script

cd ~/Library/Application\ Support/nushell

# Use nushell - ignore sourced_file_not_found - will be auto-generated by script below
nu

# Make sure script is executable then setup integrations directory and symlinks
chmod +x integrations_setup.sh
./integrations_setup.sh

4. Restart Nushell & Ghostty

# Restart nushell
# if not in nushell directory
    # nu
    # cd `~/Library/Application Support/nushell`
source config.nu

Close and reopen Ghostty terminal to apply all configurations.

Explore usage guide or quickly check core tools which ghostty nu starship.

πŸ–₯️ Editor Integration

Cursor (VS Code)

To use Nushell as your default terminal in Cursor and enable Alt keybindings:

  1. Open Cursor Settings (Cmd+Shift+P)
  2. Type and select "Open Settings (JSON)"
  3. Add (or modify) the following configuration:
{
    // Set Nushell as default terminal
    "terminal.integrated.defaultProfile.osx": "nu",

    // Enable Alt keybindings
    "terminal.integrated.macOptionIsMeta": true, // or "left"q

    // Terminal profiles
    "terminal.integrated.profiles.osx": {
        "nu": {
            "path": "/opt/homebrew/bin/nu", // Use path from "which nu"
            "args": []
        },
        "bash": {
            "path": "/bin/bash"
        },
        "zsh": {
            "path": "/bin/zsh"
        }
    }
}

What this does:

  • Sets Nushell as your default terminal in Cursor
  • Left and right Options (βŒ₯) key works as Alt for keybindings (Alt+C, Alt+Z, etc.)
  • Keeps bash and zsh available as alternative profiles

Note: Restart Cursor after making these changes.

Neovim

If using Neovim inside Nushell, your shell configuration automatically applies. No additional setup needed!

πŸ“– Usage Guide

Keybindings

Keybinding Action Use Case
Ctrl+R Search command history Find previously used commands
Ctrl+T Insert file path Build commands: git add <Ctrl+T>
Alt+C Browse & change directory Navigate to any folder recursively
Alt+Z Jump to frequent directory Quick access to often-used dirs

Power Functions (Type and press Enter)

Command Description Example
f Browse files (returns path) f β†’ select β†’ get filename
fv Browse and open in nvim fv β†’ select β†’ opens in nvim
fo Browse and open with default app fo β†’ select β†’ opens PDF/etc
fc Browse and display contents fc β†’ select β†’ shows with bat
rgf "pattern" Search file contents (includes hidden) rgf "TODO" β†’ find in .eslintrc, etc.
rgfa "pattern" Search everything (ignores .gitignore) rgfa "API_KEY" β†’ search node_modules too

Improved CLI Tools

Old New Description
cat bat Syntax highlighting, line numbers
find fd Faster, simpler, respects .gitignore
grep rg Ripgrep - much faster searching
cd z Zoxide - smart directory jumping

Quick Commands

# Navigation
..                    # Up one directory (zoxide)
...                   # Up two directories
-                     # Jump to previous directory
zz                    # Interactive directory jump

# File viewing
cat file.txt          # View with syntax highlighting (bat)
catl file.txt         # View without decorations
cata file.txt         # View with paging

# Finding files
fdf                   # Find files only
fdd                   # Find directories only
fda                   # Find all (including gitignored)

# Searching content
rg "pattern"          # Search in files
rgi "pattern"         # Case-insensitive search
rgl "pattern"         # Just show filenames
rga "pattern"         # Search all (including gitignored)

# Editors
v file.txt            # Open in nvim
vi file.txt           # Open in nvim
cs file.txt           # Open in Cursor
cu file.txt           # Open in Cursor
o file.pdf            # Open with default app

# Utilities
ll                    # List with sorting
la                    # List all with sorting
ls  dir1 dir2         # List contents of one or more directories
psf                   # Browse processes interactively
envf                  # Browse environment variables

🎨 Customizations

Add Own Aliases

Create a new file (e.g., aliases_custom.nu):

# My custom aliases
alias myalias = echo "Hello!"

Then source it in config.nu:

source ($nu.default-config-dir | path join "aliases_custom.nu")

Modify Keybindings

Edit navigation.nu and adjust the keybindings section. After changes:

source ($nu.default-config-dir | path join "config.nu")

Change Theme

Edit config.nu and modify the $env.config.color_config section. Current theme is Catppuccin Mocha.

πŸ”„ Updating Integration Files

To update starship, zoxide, or mise, regenerate their integration files:

starship init nu | save -f ($nu.default-config-dir | path join "integrations/starship.nu")
zoxide init nushell | save -f ($nu.default-config-dir | path join "integrations/zoxide.nu")
mise activate nu | save -f ($nu.default-config-dir | path join "integrations/mise.nu")

πŸ–₯️ Platform Differences

Platform Config Location
macOS ~/Library/Application Support/nushell/
Linux ~/.config/nushell/
Windows %APPDATA%\nushell\

Use $nu.default-config-dir in configs for cross-platform compatibility.

πŸ“š Learning Resources

🀝 Contributing

Feel free to:

  • Add custom aliases
  • Improve documentation
  • Extend CLI tools, themes, configs
  • Report issues

πŸ“ Notes

  • The integrations/ folder contains auto-generated files - don't edit them directly
  • Use def for complex functions with pipes, alias for simple replacements
  • Power functions require Enter to activate, keybindings are just key presses
  • Aliases are organized by category for easy maintenance
  • All configs use $nu.default-config-dir for cross-platform compatibility

πŸ› Troubleshooting

Alt key not working on macOS?

Add to Ghostty config (~/.config/ghostty/config):

macos-option-as-alt = true

Note: Restart Ghostty after making this change.

Keybinding not working?

Check if another keybinding conflicts:

$env.config.keybindings | where modifier == alt and keycode == char_c

Note: If you see multiple entries with the same modifier+keycode, you have a conflict.

Where is my config directory?

echo $nu.default-config-dir

How to view my current configuration?

$env.config
$env.config.keybindings
$env.HOME

πŸš€ All set! Made with ❀️ for me and fellow terminal enthusiasts.

About

Ghostinnu: Ghostty terminal running Nushell with Starship prompt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors