Skip to content

aymaneallaoui/setup-terminal

Repository files navigation

Universal Terminal Setup πŸš€

Terminal Preview

A one-run script that automatically sets up a beautiful and powerful terminal environment for both Windows PowerShell and Linux/WSL!

✨ What's New

  • 🎯 One-click setup - No more 5 manual steps!
  • πŸ”„ Cross-platform - Works on Windows, Linux, WSL, and macOS
  • πŸ€– Smart detection - Automatically detects your environment
  • ⚑ Modern tools - Uses the latest terminal enhancements

πŸš€ Quick Start

One-Line Installation

# Download and run the setup script
curl -fsSL https://raw.githubusercontent.com/aymaneallaoui/setup-terminal/master/setup.sh | bash

Or download and run manually:

# Clone the repository
git clone https://github.com/aymaneallaoui/setup-terminal.git
cd setup-terminal

# Make the script executable and run it
chmod +x setup.sh
./setup.sh

Windows PowerShell Alternative

If you're on Windows and prefer PowerShell:

# Run directly in PowerShell
iwr -useb https://raw.githubusercontent.com/aymaneallaoui/setup-terminal/master/setup.ps1 | iex

🎨 Features

πŸ–ΌοΈ Beautiful Terminal Icons

Terminal Icons

πŸ“œ Enhanced Command History

Command History

πŸ” Fuzzy File Finder

Use Ctrl + F to search for files and Ctrl + R to search command history File Finder

πŸ”§ Improved Git Experience

Git Integration

Git commands auto-completion: git ch + Tab β†’ git checkout

⚑ PowerShell Auto-Completion

PowerShell Completion

PowerShell commands auto-completion: Get- + Tab β†’ Get-Command

πŸ› οΈ What Gets Installed

For Linux/WSL:

  • fzf - Fuzzy finder for files and command history
  • Starship - Beautiful, fast prompt
  • Zsh + Oh My Zsh (if Zsh is available)
  • Zsh plugins:
    • zsh-autosuggestions
    • zsh-syntax-highlighting
    • powerlevel10k theme
  • Git integration with helpful aliases
  • Enhanced Bash configuration (if Zsh not available)

For Windows PowerShell:

  • Oh My Posh - Beautiful prompt system
  • Scoop - Package manager for Windows
  • PowerShell modules:
    • PSReadLine - Enhanced command line editing
    • Terminal-Icons - File and folder icons
    • Posh-Git - Git integration
    • PSFzf - Fuzzy finder integration
  • fzf - File and history search
  • Git aliases and auto-completion

πŸŽ›οΈ Key Bindings

Shortcut Function
Ctrl + R Search command history
Ctrl + F Find files
Tab Auto-complete commands/paths
↑/↓ Navigate command history

πŸ“‹ Git Aliases

The setup includes these helpful git aliases:

gs    # git status
ga    # git add
gc    # git commit
gp    # git push
gl    # git log --oneline
gd    # git diff
gb    # git branch
gco   # git checkout

πŸ”§ Customization

Changing Themes

For Zsh (Linux/WSL):

# Edit ~/.zshrc and change the theme line
ZSH_THEME="powerlevel10k/powerlevel10k"

For PowerShell:

# Edit your PowerShell profile and change the Oh My Posh theme
oh-my-posh init pwsh --config "path/to/your/theme.omp.json" | Invoke-Expression

Adding Custom Aliases

Linux/WSL: Add to ~/.zshrc or ~/.bashrc:

alias myalias='my command'

PowerShell: Add to your PowerShell profile:

Set-Alias myalias 'My-Command'

πŸ› Troubleshooting

Script Won't Run

Make sure the script is executable:

chmod +x setup.sh

PowerShell Execution Policy Error

Run this in PowerShell as Administrator:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Missing Dependencies

The script automatically installs dependencies, but if you encounter issues:

Linux/WSL:

sudo apt update && sudo apt install curl git build-essential

Windows: Install Git and PowerShell from their official websites.

WSL Specific Issues

If you're using WSL and encounter font issues, install a Nerd Font in Windows Terminal:

  1. Download a Nerd Font (e.g., FiraCode Nerd Font)
  2. Install it in Windows
  3. Set it as the font in Windows Terminal settings

πŸ†• Migration from Old Setup

If you were using the old 5-step process:

  1. Backup your current config (optional):

    cp ~/.zshrc ~/.zshrc.backup
    cp $PROFILE $PROFILE.backup  # PowerShell
  2. Run the new setup:

    curl -fsSL https://raw.githubusercontent.com/aymaneallaoui/setup-terminal/master/setup.sh | bash
  3. Restart your terminal

The new setup will automatically detect and preserve compatible configurations.

🀝 Contributing

Want to improve this setup? Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Test on different environments
  5. Submit a pull request

Adding Support for New Shells/OS

The script is designed to be extensible. To add support for a new environment:

  1. Add detection logic in detect_environment()
  2. Create a new setup function (e.g., setup_fish())
  3. Add the case in the main function
  4. Test thoroughly

πŸ“œ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments


πŸŽ‰ Enjoy Your Enhanced Terminal!

After installation, restart your terminal and enjoy:

  • ⚑ Faster workflow with fuzzy finding
  • 🎨 Beautiful, informative prompts
  • πŸ”§ Powerful git integration
  • πŸ“ Enhanced command editing
  • πŸš€ Cross-platform consistency

Star this repo if it helped you! ⭐