[GUIA] Configuração do tema SpaceShip com ZSH

Spaceship

Neste guia abordaremos como você pode instalar e configurar o tema Spaceship no seu ZSH.

O link do tema para obter mais informações: https://spaceship-prompt.sh/


1. Criando pasta de temas

git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

2. Configurações

# Seleção de tema
sed -i -E 's/(ZSH_THEME)=".*/\1="spaceship"/' ~/.zshrc

3. Crie o arquivo de configuração do spaceship

code ~/.config/spaceship.zsh

4. Adicione o conteúdo abaixo no spaceship.zsh

## Tema spaceship

LS_COLORS=$LS_COLORS:'ow=01;34:' ; export LS_COLORS
 
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
  jobs          # Background jobs indicator
  exit_code     # Exit code section
  char          # Prompt character
)
 
SPACESHIP_USER_SHOW="always" # Shows System user name before directory name
 
SPACESHIP_PROMPT_ADD_NEWLINE=false
# SPACESHIP_PROMPT_SEPARATE_LINE=false # Make the prompt span across two lines
# SPACESHIP_DIR_TRUNC=1 # Shows only the last directory folder name
 
SPACESHIP_CHAR_SYMBOL="❯"
SPACESHIP_CHAR_SUFFIX=" "

Crédito ao @Rodrigo_Sakaguchi pelo guia fantástico. :rocket:

7 curtidas