Skip to content

Instantly share code, notes, and snippets.

@shreyansp
Created June 8, 2022 17:05
Show Gist options
  • Save shreyansp/b293233e7cba22e00fb617d39b7bb6bb to your computer and use it in GitHub Desktop.
Save shreyansp/b293233e7cba22e00fb617d39b7bb6bb to your computer and use it in GitHub Desktop.

Dev Terminal Setup

oh-my-zsh

# Install zsh
    $ sudo apt install zsh
    $ zsh --version
    zsh 5.8 (aarch64-unknown-linux-gnu)

# Set default shell to zsh
    $ sudo chsh -s $(which zsh) $(whoami)
    # or 
    $ chsh -s $(which zsh)
    # or 
    ## If above doesn't work, set this at the top of ~/.bashrc
        if test -t 1; then
        exec zsh
        fi

# Install oh-my-zsh
    $ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

oh-my-zsh (extras)

Ref: https://dev.to/abdfnx/oh-my-zsh-powerlevel10k-cool-terminal-1no0

# Install powerlevel10k
    $ echo $ZSH_CUSTOM
    $ git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k    
    $ vi ~/.zshrc
        # Update
        ZSH_THEME="powerlevel10k/powerlevel10k"
    
    # Restart terminal session, and follow p10k prompts to setup

    # If p10k reconfiguration required
    $ p10k configure


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

    $ vi ~/.zshrc
        # Update
        plugins=(git docker zsh-autosuggestions zsh-syntax-highlighting)

# Make directory colors readable
    $ vi ~/.zshrc
        # Add
            # Overwrite unreadable OTHER_WRITABLE directory color
            # Ref: https://askubuntu.com/questions/466198/how-do-i-change-the-color-for-directories-with-ls-in-the-console
            LS_COLORS=$LS_COLORS:'ow=30;42:' ; export LS_COLORS

# Install exa (replacement for ls)
    # Ref: https://askubuntu.com/questions/1290500/unable-to-locate-package-for-exa-on-wsl-2-ubuntu
    # Packages: https://launchpad.net/ubuntu/+source/rust-exa/+publishinghistory
    $ wget -c http://old-releases.ubuntu.com/ubuntu/pool/universe/r/rust-exa/exa_0.9.0-4_arm64.deb -P /tmp/
    $ sudo apt-get install /tmp/exa_0.9.0-4_arm64.deb

    $ vi ~/.zshrc

    if [ -x "$(command -v exa)" ]; then
        alias ls="exa"
        alias ll="exa --long --all --group -h"
    fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment