Featured image of post oh-my-zsh Shell Configuration for Commandline Users

oh-my-zsh Shell Configuration for Commandline Users

An elegant configuration for Linux/macOS commandline shells and vim airline

Shell Configuration

Here’s how it looks like:

Shell Appearence

Features

Install

  1. Install Meslo Nerd Font

    Download these four ttf files:

    Double-click on each file and click “Install”. This will make MesloLGS NF font available to all applications on your system.

    For setting up the font in the preference of the terminals, please refer to p10k Font.

  2. Update apt sources

    1
    
    sudo apt update
    
  3. Install prerequisite tools (git, wget, python3, pip3)

    1
    
    sudo apt install wget git python3-dev python3-pip python3-setuptools
    
  4. Install zsh

    • Ubuntu, Debian & derivatives

      1
      
      sudo apt install zsh
      
    • Arch Linux or Manjaro

      1
      
      sudo pacman -S zsh
      
    • macOS has zsh pre-installed

  5. Install oh-my-zsh via wget

    1
    
    sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
  6. Install powerlevel10k

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

    • zsh-autosuggestions
      1
      
      git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
      
    • zsh-syntax-highlighting
      1
      
      git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
      
  8. Download configuration files and link to home directory

    1. Download ShellConfig from GitHub
      1
      2
      3
      
      mkdir -p ~/Documents/GitHub
      cd ~/Documents/GitHub
      git clone https://github.com/jin-li/ShellConfig.git 
      
    2. Backup old configuration files
      1
      2
      
      mv ~/.bashrc ~/.bashrc_bak
      mv ~/.zshrc ~/.zshrc_bak
      
    3. Link configuration files to home directory
      1
      2
      3
      
      ln ~/Documents/GitHub/ShellConfig/.bashrc ~/.bashrc
      ln ~/Documents/GitHub/ShellConfig/.zshrc ~/.zshrc
      ln ~/Documents/GitHub/ShellConfig/.p10k.zsh ~/.p10k.zsh
      
  9. Restart terminal

Vim Configuration

Vim Appearance

Features

Prerequisite

The default vim in Debian OS is vim-tiny, which does not support the plugins. Use following command to check your vim version first before using this configuration.

1
vi --version

If there is “Small version without GUI” in the output, it means your vim is vim-tiny. You can remove it and install the full version vim using following command:

1
2
sudo apt remove vim-tiny
sudo apt install vim

Configuration

  1. Install Vundle

    1
    
    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    
  2. Link configuration file to home directory

    1
    
    ln ~/Documents/GitHub/ShellConfig/.vimrc ~/.vimrc
    
  3. Install plugins in Vim, type following command in Vim

    1
    
    :PluginInstall
    

    Plugins will be installed automatically, wait until the install completed.

  4. Other plugins can be installed easily via Vundle

comments powered by Disqus