O terminal é uma ferramenta poderosa, mas a versão padrão do macOS pode ser monótona. Vamos transformá-lo num ambiente visualmente atraente e altamente funcional com: Realce de sintaxe para comandos, LS colorido para melhor visualização de arquivos, CAT melhorado com syntax highlighting, Tema Powerlevel10k para um prompt informativo

Baseado no guia de Aman Kumar, mas com melhorias e adaptações.

Pré-requisitos

✅ macOS ou Linux
✅ Homebrew instalado
✅ Terminal aberto e privilégios de administrador

1. Instalar Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Mais informação AQUI

2. Realce de Sintaxe (zsh-syntax-highlighting)

brew install zsh-syntax-highlighting


Adicione ao final do seu ~/.zshrc:

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

3. LS Colorido (lsd)

Instalar fontes Nerd:

brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font

Instalar lsd:

brew install lsd

Configure um alias no ~/.zshrc:

alias ls='lsd'
alias ll='lsd -l'
alias la='lsd -a'

4. CAT Melhorado (bat)

brew install bat

Configure no ~/.zshrc:

export BAT_THEME='gruvbox-dark'
alias cat='bat --paging=never'

Para ver todos os temas disponíveis:

bat --list-themes

5. Tema Powerlevel10k Baixe e instale manualmente as Meslo Nerd Fonts.

Instalar tema:

brew install romkatv/powerlevel10k/powerlevel10k
echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc

Configuração Final do .zshrc

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /opt/homebrew/opt/powerlevel10k/share/powerlevel10k/powerlevel10k.zsh-theme

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

export BAT_THEME='gruvbox-dark'
alias cat='bat --paging=never'
alias ls='lsd'
alias ovh-fuzzalab='ssh slackie@fuzzalab.pt'
alias ovh-fuzzalab-root='ssh root@fuzzalab.pt'
alias ovh-mount-home='sshfs slackie@fuzzalab.pt:/home/slackie /Users/mrfuzza/RemoteServerMountPoints/ovh-slackie-home'
alias ovh-mount-varwww='sshfs root@fuzzalab.pt:/var/www /Users/mrfuzza/RemoteServerMountPoints/ovh-slackie-varwww -ocache=no -onolocalcaches -ovolname=ssh' 
alias ovh-umount-varwww='umount root@fuzzalab.pt:/var/www'
export VIRTUAL_ENV_DISABLE_PROMPT=0

export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH"

# Added by LM Studio CLI (lms)
export PATH="$PATH:/Users/mrfuzza/.lmstudio/bin"
export PATH="/usr/local/opt/python@3.11/bin:$PATH"

Previous Post Next Post

Add a comment