Skip to content

Instantly share code, notes, and snippets.

@junielton
Forked from yovko/ohmyzsh.md
Last active September 7, 2022 11:25
Show Gist options
  • Select an option

  • Save junielton/9df0424d8fc8c646eb116a1256aa5d8d to your computer and use it in GitHub Desktop.

Select an option

Save junielton/9df0424d8fc8c646eb116a1256aa5d8d to your computer and use it in GitHub Desktop.
ZSH (using Oh My ZSH) on Manjaro Linux

ZSH (using Oh My ZSH) on Manjaro Linux

0. If ZSH is not already installed on your Manjaro system you can do it with the command:

sudo pacman -Syu zsh

You do not need to install manjaro-zsh-config and all the other related packages like zsh-syntax-highlighting, zsh-history-substring-search, zsh-autosuggestions, etc., as we will use Oh My Zsh.

1. Install Oh My ZSH

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

or

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

2. Installation of two important plugins I can't live without

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

and

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

3. Configuring zsh

Modify the ~/.zshrc config file editting plugins section like this:

plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
)

Install Spaceship theme

git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"

Create a simbolic link to theme files in your oh-my-zsh folder

ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

Now insid the file ~/.zshrc we will change variable ZSH_THEME like this:

ZSH_THEME="spaceship"

Here area some optional option to add in the end of ~/.zshrc file.

SPACESHIP_PROMPT_ORDER=(
  user          # Username section
  dir           # Current directory section
  host          # Hostname section
  git           # Git section (git_branch + git_status)
  hg            # Mercurial section (hg_branch  + hg_status)
  exec_time     # Execution time
  line_sep      # Line break
  vi_mode       # Vi-mode indicator
  jobs          # Background jobs indicator
  exit_code     # Exit code section
  char          # Prompt character
)
SPACESHIP_USER_SHOW=always
SPACESHIP_PROMPT_ADD_NEWLINE=false
SPACESHIP_CHAR_SYMBOL="❯"
SPACESHIP_CHAR_SUFFIX=" "

4. Logout/logon or apply the changes with:

source ~/.zshrc

5. Make zsh default if you haven't already:

chsh -s $(which zsh)

6. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment