Wangze Tech Blog

website·Indexed 29 days ago

https://wangze.tech

A collection of technical guides and posts covering macOS settings, zsh installation, and the configuration of tools like Karabiner-Elements and Capslock.

Tokens
2.6K
Snippets
24
Records
25
Agent score
7%

What's inside Wangze Tech

  1. Configure automatic plugin updates for Linux

    Install the OhMyZsh-full-autoupdate plugin to automatically keep your Zsh plugins updated on Linux systems.
    cd ~/.oh-my-zsh/custom/plugins
    git clone https://github.com/Pilaton/OhMyZsh-full-autoupdate.git
    
    # Add to ~/.zshrc
    plugins=(... ohmyzsh-full-autoupdate)
  2. Manage multiple PHP versions on macOS

    Install specific PHP versions using Homebrew and switch between them by unlinking the current version and linking the target version.
    # Install versions
    brew install php@8.2
    brew install shivammathur/php/php@7.4
    
    # Switch to PHP 8.2
    brew unlink php
    brew unlink php@8.2
    brew link --force --overwrite php@8.2
  3. Install Oh My Zsh

    Install the Oh My Zsh framework using the official installation script via curl.
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  4. Manage multiple PHP versions with Homebrew

    Install specific PHP versions and use the unlink and link commands to switch between them.
    # Install versions
    brew install php@8.2
    brew install shivammathur/php/php@7.4
    
    # Switch to PHP 8.2
    brew unlink php
    brew unlink php@8.2
    brew link --force --overwrite php@8.2
  5. Install and manage Claude Code via Bun

    Use the Bun runtime to install and update the Claude Code CLI tool globally.
    # Install Bun
    curl -fsSL https://bun.com/install | bash
    
    # Install/Update Claude Code
    bun add -g @anthropic-ai/claude-code
  6. Set Zsh as the default shell

    Change the default system shell to Zsh. If the chsh command is unavailable, you can manually edit /etc/passwd or append the shell execution command to your .bash_profile to launch Zsh automatically.
    # Standard method
    chsh -s /bin/zsh
    
    # Alternative: Add to ~/.bash_profile if chsh is missing
    export SHELL=/bin/zsh
    exec /bin/zsh -l
  7. Install and enable Zsh plugins

    Install plugins like fast-syntax-highlighting and zsh-autosuggestions. On Linux, clone the repositories into the Oh My Zsh custom plugins directory. On macOS, use Homebrew. After installation, add the plugin names to the plugins array in your ~/.zshrc file.
    # Linux installation
    cd ~/.oh-my-zsh/custom/plugins
    git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git
    git clone https://github.com/zsh-users/zsh-autosuggestions.git
    
    # macOS installation
    brew install zsh-fast-syntax-highlighting
    brew install zsh-autosuggestions
    
    # Enable in ~/.zshrc
    plugins=(git z zsh-autosuggestions fast-syntax-highlighting)
  8. Install and configure Zsh as the default shell

    Install Zsh and set it as the default system shell. If the chsh command is unavailable, manually edit /etc/passwd or add execution logic to .bash_profile.
    # Check available shells
    chsh -l
    cat /etc/shells
    
    # Installation
    # Ubuntu
    sudo apt install zsh -y
    # Centos
    sudo yum install zsh -y
    # Mac
    brew install zsh
    
    # Set as default shell
    chsh -s /bin/zsh
    
    # Alternative if chsh is missing: add to .bash_profile
    export SHELL=/bin/zsh
    exec /bin/zsh -l
  9. Install and update macOS software via Homebrew

    Use Homebrew to install CLI tools and Cask applications. To keep all Cask applications updated, use the buo/cask-upgrade tap.
    # Install Homebrew (from brew.sh)
    
    # Setup Cask upgrade utility
    brew tap buo/cask-upgrade
    
    # One-command update for all brew packages and casks
    brew update && brew upgrade && brew cu -y --cleanup && brew cleanup && brew doctor && brew autoremove
    
    # Example tool installations
    brew install fd ripgrep fnm gh go
    brew install --cask docker-desktop visual-studio-code raycast
  10. Install and update software using Homebrew on macOS

    Homebrew is the primary package manager for macOS. Use brew install for CLI tools and brew install --cask for GUI applications. To keep all casks updated, use the cask-upgrade tap.
    # Install Homebrew first from https://brew.sh/
    
    # Enable cask upgrade functionality
    brew tap buo/cask-upgrade
    
    # One-command update for all brew packages and casks
    brew update && brew upgrade && brew cu -y --cleanup && brew cleanup && brew doctor && brew autoremove
    
    # Example: Install a GUI app
    brew install --cask apifox
    
    # Example: Install CLI tools
    brew install fd ripgrep