Skip to content

Instantly share code, notes, and snippets.

@android10
Last active June 1, 2025 20:55
Show Gist options
  • Select an option

  • Save android10/3a061b3a85ad9fd6832ae25efc4381b0 to your computer and use it in GitHub Desktop.

Select an option

Save android10/3a061b3a85ad9fd6832ae25efc4381b0 to your computer and use it in GitHub Desktop.

Revisions

  1. android10 revised this gist Jan 5, 2021. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions oh-my-zsh-powerlevel9k-theme.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    ### Attention: This is DEPRECATED in favor of PowerLevel10K, I wrote an article about it:

    - [Change default shell on Arch Linux](https://fernandocejas.com/blog/engineering/2020-12-28-install-arch-linux-full-disk-encryption/#default-shell)

    ### Install oh-my-zsh with powerlevel9k theme on Arch Linux
    This gist aims to facilitate the switching from ```bash``` to ```zsh``` as our defaut shell.
    We will be using oh-my-zsh with the powerful theme: Powerlevel9k. You will find all the links below.
  2. android10 revised this gist Mar 22, 2019. 1 changed file with 19 additions and 3 deletions.
    22 changes: 19 additions & 3 deletions oh-my-zsh-powerlevel9k-theme.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ I'm also using Gnome Terminal and pacaur as package manager.

    ### Step 1: Install Zsh (if not currently using it)
    ```
    pacaur -S oh-my-zsh-git
    pacaur -S zsh oh-my-zsh-git
    ```

    ### Step 2: Make Zsh your default shell (restart so your shell change takes effect)
    @@ -81,8 +81,24 @@ HYPHEN_INSENSITIVE="true"
    COMPLETION_WAITING_DOTS="true"
    # /!\ do not use with zsh-autosuggestions
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize
    command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    plugins=(archlinux
    asdf
    bundler
    docker
    jsontools
    vscode
    web-search
    k
    tig
    gitfast
    colored-man-pages
    colorize
    command-not-found
    cp
    dirhistory
    autojump
    sudo
    zsh-syntax-highlighting)
    # /!\ zsh-syntax-highlighting and then zsh-autosuggestions must be at the end
    source $ZSH/oh-my-zsh.sh
  3. android10 revised this gist Mar 22, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions oh-my-zsh-powerlevel9k-theme.md
    Original file line number Diff line number Diff line change
    @@ -20,15 +20,15 @@ I'm also using Gnome Terminal and pacaur as package manager.
    pacaur -S oh-my-zsh-git
    ```

    ### Step 2: Make Zsh your default shell
    ### Step 2: Make Zsh your default shell (restart so your shell change takes effect)
    ```
    chsh -l
    chsh -s /usr/bin/zsh
    ```

    ### Step 3: Install the Powerlevel9k theme
    ```
    $ git clone https://github.com/bhilburn/powerlevel9k.git /usr/share/oh-my-zsh/themes/powerlevel9k
    $ sudo git clone https://github.com/bhilburn/powerlevel9k.git /usr/share/oh-my-zsh/themes/powerlevel9k
    ```

    ### Step 4: Install Nerd Fonts Hack
  4. android10 revised this gist Mar 13, 2019. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions oh-my-zsh-powerlevel9k-theme.md
    Original file line number Diff line number Diff line change
    @@ -13,9 +13,7 @@ I'm also using Gnome Terminal and pacaur as package manager.
    - Nerd Fonts: https://nerdfonts.com/

    ### Here is how the result looks like



    ![oh-my-zsh-theme](https://user-images.githubusercontent.com/1360604/54271345-9e460f00-4581-11e9-8fef-32c53cbd91aa.png)

    ### Step 1: Install Zsh (if not currently using it)
    ```
  5. android10 revised this gist Mar 13, 2019. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions oh-my-zsh-powerlevel9k-theme.md
    Original file line number Diff line number Diff line change
    @@ -1,47 +1,47 @@
    #### Description
    ### Install oh-my-zsh with powerlevel9k theme on Arch Linux
    This gist aims to facilitate the switching from ```bash``` to ```zsh``` as our defaut shell.
    We will be using oh-my-zsh with the powerful theme: Powerlevel9k. You will find all the links below.
    This process applies mainly for Arch Linux, but can be setup for any other distro (in theory :)).
    I'm also using Gnome Terminal and pacaur as package manager.

    #### Resources
    ### Resources
    - Zsh: https://wiki.archlinux.org/index.php/zsh
    - Default shell: https://wiki.archlinux.org/index.php/Command-line_shell#Changing_your_default_shell
    - Oh-my-zsh: https://ohmyz.sh/
    - Oh-my-zsh plugins: https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
    - Powerlevel9k theme: https://github.com/bhilburn/powerlevel9k
    - Nerd Fonts: https://nerdfonts.com/

    #### Here is how the result looks like
    ### Here is how the result looks like




    #### Step 1: Install Zsh (if not currently using it)
    ### Step 1: Install Zsh (if not currently using it)
    ```
    pacaur -S oh-my-zsh-git
    ```

    #### Step 2: Make Zsh your default shell
    ### Step 2: Make Zsh your default shell
    ```
    chsh -l
    chsh -s /usr/bin/zsh
    ```

    #### Step 3: Install the Powerlevel9k theme
    ### Step 3: Install the Powerlevel9k theme
    ```
    $ git clone https://github.com/bhilburn/powerlevel9k.git /usr/share/oh-my-zsh/themes/powerlevel9k
    ```

    #### Step 4: Install Nerd Fonts Hack
    ### Step 4: Install Nerd Fonts Hack
    ```
    pacaur -S nerd-fonts-hack
    ```

    #### Step 5: Migrate from Bash (skip if you are already using it)
    ### Step 5: Migrate from Bash (skip if you are already using it)
    You will have to move some content from your files ```.bash_profile``` and ```.bashrc``` to ```.zshrc``` and ```.zprofile``` respectively.

    #### Step 6: Theme configuration in .zshrc file (copy and paste :))
    ### Step 6: Theme configuration in .zshrc file (copy and paste :))
    ```
    # Path to your oh-my-zsh installation.
    ZSH=/usr/share/oh-my-zsh/
    @@ -144,13 +144,13 @@ fi
    source $ZSH/oh-my-zsh.sh
    ```

    #### Step 7: Add more plugins if you want, here are mine
    ### Step 7: Add more plugins if you want, here are mine
    ```
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize
    command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    ```

    #### Step 8: Setup font in GNOME (skip if not a GNOME user)
    ### Step 8: Setup font in GNOME (skip if not a GNOME user)
    - Install GNOME Tweaks in case you have GNOME
    - Set the system monospace font to "Hack Nerd Font Regular"
    - In the Terminal's Font Preference, I leave the Custom Font option unchecked, .i.e use system font.
  6. android10 revised this gist Mar 13, 2019. 1 changed file with 16 additions and 9 deletions.
    25 changes: 16 additions & 9 deletions oh-my-zsh-powerlevel9k-theme.md
    Original file line number Diff line number Diff line change
    @@ -5,12 +5,12 @@ This process applies mainly for Arch Linux, but can be setup for any other distr
    I'm also using Gnome Terminal and pacaur as package manager.

    #### Resources
    - Zsh: https://wiki.archlinux.org/index.php/zsh
    - Default shell: https://wiki.archlinux.org/index.php/Command-line_shell#Changing_your_default_shell
    - Oh-my-zsh: https://ohmyz.sh/
    - Oh-my-zsh plugins: https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
    - Powerlevel9k theme: https://github.com/bhilburn/powerlevel9k
    - Nerd Fonts: https://nerdfonts.com/
    - Zsh: https://wiki.archlinux.org/index.php/zsh
    - Default shell: https://wiki.archlinux.org/index.php/Command-line_shell#Changing_your_default_shell
    - Oh-my-zsh: https://ohmyz.sh/
    - Oh-my-zsh plugins: https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
    - Powerlevel9k theme: https://github.com/bhilburn/powerlevel9k
    - Nerd Fonts: https://nerdfonts.com/

    #### Here is how the result looks like

    @@ -83,7 +83,8 @@ HYPHEN_INSENSITIVE="true"
    COMPLETION_WAITING_DOTS="true"
    # /!\ do not use with zsh-autosuggestions
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize
    command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    # /!\ zsh-syntax-highlighting and then zsh-autosuggestions must be at the end
    source $ZSH/oh-my-zsh.sh
    @@ -145,5 +146,11 @@ source $ZSH/oh-my-zsh.sh

    #### Step 7: Add more plugins if you want, here are mine
    ```
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    ```
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize
    command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    ```

    #### Step 8: Setup font in GNOME (skip if not a GNOME user)
    - Install GNOME Tweaks in case you have GNOME
    - Set the system monospace font to "Hack Nerd Font Regular"
    - In the Terminal's Font Preference, I leave the Custom Font option unchecked, .i.e use system font.
  7. android10 revised this gist Mar 13, 2019. 1 changed file with 129 additions and 2 deletions.
    131 changes: 129 additions & 2 deletions oh-my-zsh-powerlevel9k-theme.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,133 @@ I'm also using Gnome Terminal and pacaur as package manager.



    #### Step 1:
    #### Step 1: Install Zsh (if not currently using it)
    ```
    pacaur -S oh-my-zsh-git
    ```

    #### Plugins used with Oh my zsh (it is a matter of taste here)
    #### Step 2: Make Zsh your default shell
    ```
    chsh -l
    chsh -s /usr/bin/zsh
    ```

    #### Step 3: Install the Powerlevel9k theme
    ```
    $ git clone https://github.com/bhilburn/powerlevel9k.git /usr/share/oh-my-zsh/themes/powerlevel9k
    ```

    #### Step 4: Install Nerd Fonts Hack
    ```
    pacaur -S nerd-fonts-hack
    ```

    #### Step 5: Migrate from Bash (skip if you are already using it)
    You will have to move some content from your files ```.bash_profile``` and ```.bashrc``` to ```.zshrc``` and ```.zprofile``` respectively.

    #### Step 6: Theme configuration in .zshrc file (copy and paste :))
    ```
    # Path to your oh-my-zsh installation.
    ZSH=/usr/share/oh-my-zsh/
    export DEFAULT_USER="fernando"
    export TERM="xterm-256color"
    export ZSH=/usr/share/oh-my-zsh
    ZSH_THEME="powerlevel9k/powerlevel9k"
    POWERLEVEL9K_MODE="nerdfont-complete"
    source $ZSH/themes/powerlevel9k/powerlevel9k.zsh-theme
    POWERLEVEL9K_FOLDER_ICON=""
    POWERLEVEL9K_HOME_SUB_ICON="$(print_icon "HOME_ICON")"
    POWERLEVEL9K_DIR_PATH_SEPARATOR=" $(print_icon "LEFT_SUBSEGMENT_SEPARATOR") "
    POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
    POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true
    POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND='black'
    POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND='178'
    POWERLEVEL9K_NVM_BACKGROUND="238"
    POWERLEVEL9K_NVM_FOREGROUND="green"
    POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="blue"
    POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="015"
    POWERLEVEL9K_TIME_BACKGROUND='255'
    #POWERLEVEL9K_COMMAND_TIME_FOREGROUND='gray'
    POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='245'
    POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='black'
    POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"
    POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator context dir dir_writable vcs)
    POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs command_execution_time time)
    POWERLEVEL9K_SHOW_CHANGESET=true
    HYPHEN_INSENSITIVE="true"
    COMPLETION_WAITING_DOTS="true"
    # /!\ do not use with zsh-autosuggestions
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    # /!\ zsh-syntax-highlighting and then zsh-autosuggestions must be at the end
    source $ZSH/oh-my-zsh.sh
    ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
    typeset -gA ZSH_HIGHLIGHT_STYLES
    ZSH_HIGHLIGHT_STYLES[cursor]='bold'
    ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold'
    ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,bold'
    ZSH_HIGHLIGHT_STYLES[builtin]='fg=green,bold'
    ZSH_HIGHLIGHT_STYLES[function]='fg=green,bold'
    ZSH_HIGHLIGHT_STYLES[command]='fg=green,bold'
    ZSH_HIGHLIGHT_STYLES[precommand]='fg=green,bold'
    ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green,bold'
    rule () {
    print -Pn '%F{blue}'
    local columns=$(tput cols)
    for ((i=1; i<=columns; i++)); do
    printf "\u2588"
    done
    print -P '%f'
    }
    function _my_clear() {
    echo
    rule
    zle clear-screen
    }
    zle -N _my_clear
    bindkey '^l' _my_clear
    # Ctrl-O opens zsh at the current location, and on exit, cd into ranger's last location.
    ranger-cd() {
    tempfile=$(mktemp)
    ranger --choosedir="$tempfile" "${@:-$(pwd)}" < $TTY
    test -f "$tempfile" &&
    if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
    cd -- "$(cat "$tempfile")"
    fi
    rm -f -- "$tempfile"
    # hacky way of transferring over previous command and updating the screen
    VISUAL=true zle edit-command-line
    }
    zle -N ranger-cd
    bindkey '^o' ranger-cd
    # Uncomment the following line to disable bi-weekly auto-update checks.
    DISABLE_AUTO_UPDATE="true"
    ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
    if [[ ! -d $ZSH_CACHE_DIR ]]; then
    mkdir $ZSH_CACHE_DIR
    fi
    source $ZSH/oh-my-zsh.sh
    ```

    #### Step 7: Add more plugins if you want, here are mine
    ```
    plugins=(archlinux asdf bundler docker jsontools vscode web-search k tig gitfast colored-man colorize command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting)
    ```
  8. android10 renamed this gist Mar 13, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. android10 created this gist Mar 13, 2019.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #### Description
    This gist aims to facilitate the switching from ```bash``` to ```zsh``` as our defaut shell.
    We will be using oh-my-zsh with the powerful theme: Powerlevel9k. You will find all the links below.
    This process applies mainly for Arch Linux, but can be setup for any other distro (in theory :)).
    I'm also using Gnome Terminal and pacaur as package manager.

    #### Resources
    - Zsh: https://wiki.archlinux.org/index.php/zsh
    - Default shell: https://wiki.archlinux.org/index.php/Command-line_shell#Changing_your_default_shell
    - Oh-my-zsh: https://ohmyz.sh/
    - Oh-my-zsh plugins: https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
    - Powerlevel9k theme: https://github.com/bhilburn/powerlevel9k
    - Nerd Fonts: https://nerdfonts.com/

    #### Here is how the result looks like




    #### Step 1:

    #### Plugins used with Oh my zsh (it is a matter of taste here)