Terminal

Zsh, Oh My Zsh, e configuração do terminal — produtividade na linha de comando.

O que é

O terminal é a interface principal de interação para devs. Zsh (Z Shell) é o shell padrão do macOS e popular no Linux, com features como autocompletion avançado, globbing, e plugins via Oh My Zsh.

Como funciona

Zsh vs Bash

FeatureBashZsh
AutocompletionBásicoAvançado (tab com menu)
GlobbingBásicoExtended (**/*.ts)
Themes/PluginsManualOh My Zsh / Zinit
Spelling correctionNãoSim
Right promptNãoSim (RPROMPT)

Oh My Zsh

Framework de gerenciamento de configuração Zsh com 300+ plugins e 150+ temas.

# Instalar
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
 
# Configurar (~/.zshrc)
ZSH_THEME="robbyrussell"    # ou powerlevel10k
plugins=(
  git                       # aliases git (gst, gco, gp)
  docker                    # completions docker
  kubectl                   # completions k8s
  z                         # jump to directories
  zsh-autosuggestions       # sugestões baseadas no histórico
  zsh-syntax-highlighting   # highlighting de comandos
)

Plugins essenciais

PluginO que faz
gitAliases: gst=status, gco=checkout, gp=push
zPular para diretórios frequentes: z project
zsh-autosuggestionsSugere comandos do histórico (→ para aceitar)
zsh-syntax-highlightingColore comandos válidos/inválidos
docker / kubectlAutocompletion para Docker e K8s
nvmGerenciar versões do Node.js

Ubuntu — Setup básico para devs

# Essenciais
sudo apt update && sudo apt install -y \
  git curl wget build-essential \
  zsh htop jq tree
 
# Zsh como default
chsh -s $(which zsh)
 
# Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
 
# SDKMAN (Java)
curl -s "https://get.sdkman.io" | bash
 
# NVM (Node)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
 
# Docker
# Seguir docs oficiais: https://docs.docker.com/engine/install/ubuntu/

Aliases úteis

# ~/.zshrc
alias ll='ls -la'
alias dc='docker compose'
alias k='kubectl'
alias g='git'
alias nr='npm run'
alias code='code .'

Quando usar

  • Sempre: o terminal é a ferramenta mais poderosa de um dev
  • Zsh + Oh My Zsh: em qualquer ambiente de desenvolvimento
  • Plugins: instalar os relevantes para sua stack (git, docker, kubectl, nvm)

How to explain in English

“I’m a terminal-first developer. I use Zsh with Oh My Zsh for an enhanced shell experience — autosuggestions based on history, syntax highlighting, and plugins for git, Docker, and Kubernetes. This setup significantly boosts my productivity on the command line, which is where I spend most of my time.”

Key vocabulary

  • terminal → terminal / command line
  • shell → shell: interpretador de comandos
  • alias → alias: atalho para comandos
  • plugin → plugin: extensão de funcionalidade
  • autocompletamento → autocompletion / tab completion

Recursos

Veja também