Los sábados optimizamos nuestros espacios de trabajo. Hoy enfoque en el terminal: la herramienta que más usamos pero que frecuentemente está suboptimizada. Un terminal bien configurado puede aumentar dramáticamente tu productividad diaria.
Modern Shell Setup
Zsh + Oh My Zsh: La Base Sólida
# Instalación rápida
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Plugins esenciales en ~/.zshrc
plugins=(
git
docker
node
npm
kubectl
zsh-autosuggestions
zsh-syntax-highlighting
fzf
)
Starship: Prompt Inteligente y Rápido
# Instalación
curl -sS https://starship.rs/install.sh | sh
# Configuración básica en ~/.config/starship.toml
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[➜](bold red)"
[git_branch]
symbol = "🌱 "
[nodejs]
symbol = "⬢ "
[python]
symbol = "🐍 "
[docker_context]
symbol = "🐳 "
Herramientas de CLI Modernas
Sustitutos Modernos para Comandos Clásicos
# Instalación de herramientas mejoradas
brew install exa bat fd ripgrep htop procs dust
# Aliases en ~/.zshrc
alias ls='exa --icons --git'
alias ll='exa -alF --icons --git'
alias tree='exa --tree --icons'
alias cat='bat'
alias find='fd'
alias grep='rg'
alias top='htop'
alias ps='procs'
alias du='dust'
Performance Comparison:
Comando Tradicional | Alternativa Moderna | Mejora |
---|---|---|
ls |
exa --icons |
Sintaxis coloreada + iconos |
cat |
bat |
Syntax highlighting + numeración |
find |
fd |
5x más rápido + regex simple |
grep |
ripgrep |
10x más rápido + mejor output |
top |
htop |
Interfaz visual + interactiva |
Multiplexer Setup: tmux Optimizado
Configuración Base (~/.tmux.conf)
# Prefix key más ergonómico
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Split panes intuitivos
bind | split-window -h
bind - split-window -v
# Mouse support
set -g mouse on
# Status bar moderna
set -g status-position bottom
set -g status-bg colour234
set -g status-fg colour137
set -g status-left '#[fg=colour233,bg=colour241,bold] #S '
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
Workflow con tmux Sessions
# Crear sesión para proyecto específico
tmux new-session -d -s proyecto-api
tmux send-keys -t proyecto-api 'cd ~/proyectos/api && npm run dev' C-m
tmux split-window -t proyecto-api -h
tmux send-keys -t proyecto-api 'cd ~/proyectos/api && git status' C-m
# Script de automation
#!/bin/bash
# start-dev-session.sh
SESSION="desarrollo"
tmux new-session -d -s $SESSION
# Window 1: Editor
tmux rename-window -t $SESSION:0 'editor'
tmux send-keys -t $SESSION:0 'code .' C-m
# Window 2: Server
tmux new-window -t $SESSION:1 -n 'server'
tmux send-keys -t $SESSION:1 'npm run dev' C-m
# Window 3: Git
tmux new-window -t $SESSION:2 -n 'git'
tmux send-keys -t $SESSION:2 'git status' C-m
tmux attach-session -t $SESSION
File Navigation & Management
FZF: Fuzzy Finding Superpowers
# Instalación y configuración
brew install fzf
$(brew --prefix)/opt/fzf/install
# Funciones custom en ~/.zshrc
# Buscar y editar archivos
fe() {
local files
IFS=
Z Jump: Navegación Inteligente
# Instalación
brew install z
# Uso automático después de moverte por directorios
# z proyecto -> salta al directorio más usado que contenga "proyecto"
# z api web -> combina múltiples términos
# zi -> modo interactivo con fzf
Visual Enhancements
Terminal con True Color Support
# Verificar soporte de colores
echo $TERM
# Debería mostrar: xterm-256color o similar
# Test de colores
curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash
Nerd Fonts para Iconos
# Instalación de fuente optimizada
brew tap homebrew/cask-fonts
brew install --cask font-fira-code-nerd-font
# Configurar en terminal:
# Terminal.app: Preferences > Profiles > Font > FiraCode Nerd Font
# iTerm2: Preferences > Profiles > Text > Font > FiraCode Nerd Font
Development-Specific Optimizations
Git Aliases Productivos
# Agregar a ~/.gitconfig
[alias]
st = status -s
co = checkout
br = branch
ci = commit
ca = commit -a
ps = push
pl = pull
df = diff
dc = diff --cached
lg = log --oneline --graph --decorate --all
last = log -1 HEAD
unstage = reset HEAD --
visual = !gitk
amend = commit --amend --no-edit
undo = reset --soft HEAD~1
wip = commit -am "WIP: work in progress"
Docker Helpers
# Funciones útiles en ~/.zshrc
# Limpiar containers y images
docker-cleanup() {
docker system prune -a --volumes
}
# Entrar a container running
docker-exec() {
docker exec -it $(docker ps --format "table {{.Names}}" | fzf) bash
}
# Ver logs de container específico
docker-logs() {
docker logs -f $(docker ps --format "table {{.Names}}" | fzf)
}
Node.js/npm Optimization
# Aliases para npm/yarn/pnpm
alias ni="npm install"
alias nid="npm install --save-dev"
alias nig="npm install --global"
alias nr="npm run"
alias ns="npm start"
alias nt="npm test"
alias nb="npm run build"
# Auto-switching de Node versions con .nvmrc
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
System Monitoring & Performance
Modern System Monitoring
# btop: Monitor de sistema moderno
brew install btop
# bandwhich: Monitor de red por proceso
brew install bandwhich
sudo bandwhich
# hyperfine: Benchmarking de comandos
brew install hyperfine
hyperfine 'npm run build' 'yarn build' 'pnpm build'
Custom System Info
# Función para info rápida del sistema
sysinfo() {
echo "🖥️ System Information"
echo "OS: $(uname -s) $(uname -r)"
echo "CPU: $(sysctl -n machdep.cpu.brand_string)"
echo "Memory: $(memory_pressure | grep 'System-wide memory free percentage')"
echo "Disk: $(df -h / | awk 'NR==2{printf "%s/%s (%s used)", $3,$2,$5}')"
echo "Uptime: $(uptime | awk '{print $3,$4}' | sed 's/,//')"
echo "Load: $(uptime | awk -F'load average:' '{ print $2 }')"
}
Automation Scripts
Project Initialization Script
#!/bin/bash
# new-project.sh
PROJECT_NAME=$1
PROJECT_TYPE=$2
if [ -z "$PROJECT_NAME" ]; then
echo "Usage: new-project.sh <name> <type>"
echo "Types: react, node, python, next"
exit 1
fi
mkdir $PROJECT_NAME
cd $PROJECT_NAME
case $PROJECT_TYPE in
"react")
npx create-react-app . --template typescript
;;
"next")
npx create-next-app . --typescript --tailwind --eslint
;;
"node")
npm init -y
npm install -D typescript @types/node ts-node nodemon
mkdir src
echo 'console.log("Hello, TypeScript!");' > src/index.ts
;;
"python")
python -m venv .venv
source .venv/bin/activate
echo "fastapi==0.104.1\nuvicorn==0.24.0" > requirements.txt
pip install -r requirements.txt
;;
esac
# Inicializar git
git init
echo "node_modules/\n.env\n.DS_Store\n__pycache__/\n.venv/" > .gitignore
git add .
git commit -m "Initial commit"
# Abrir en editor
code .
Daily Cleanup Script
#!/bin/bash
# cleanup.sh - Ejecutar diariamente
echo "🧹 Cleaning up development environment..."
# Limpiar node_modules huérfanos
find ~/Projects -name "node_modules" -type d -exec du -sh {} + | sort -hr | head -20
# Limpiar Docker
docker system prune -f
# Limpiar Homebrew
brew cleanup --prune=all
# Limpiar npm cache
npm cache clean --force
# Limpiar pip cache
pip cache purge
echo "✅ Cleanup completed!"
Productivity Hacks
Command History Optimization
# En ~/.zshrc
HISTSIZE=10000
SAVEHIST=10000
setopt HIST_VERIFY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt EXTENDED_HISTORY
# Buscar en history con ctrl+r mejorado
bindkey '^r' history-incremental-search-backward
Quick Note Taking
# Función para notas rápidas
note() {
echo "$(date): $*" >> ~/Documents/dev-notes.md
}
# Ver notas del día
today() {
grep "$(date '+%Y-%m-%d')" ~/Documents/dev-notes.md
}
Setup Completo en 5 Minutos
Script de Instalación Automatizada
#!/bin/bash
# terminal-setup.sh
# Instalar Homebrew si no existe
if ! command -v brew &> /dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Instalar herramientas esenciales
brew install zsh oh-my-zsh starship exa bat fd ripgrep htop tmux fzf z
# Instalar Nerd Font
brew tap homebrew/cask-fonts
brew install --cask font-fira-code-nerd-font
# Configurar plugins de zsh
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
# Backup de configuración existente
cp ~/.zshrc ~/.zshrc.backup 2>/dev/null || true
# Aplicar configuración
curl -o ~/.zshrc https://raw.githubusercontent.com/tu-repo/dotfiles/main/.zshrc
curl -o ~/.tmux.conf https://raw.githubusercontent.com/tu-repo/dotfiles/main/.tmux.conf
curl -o ~/.config/starship.toml https://raw.githubusercontent.com/tu-repo/dotfiles/main/starship.toml
echo "🎉 Terminal setup completed! Restart your terminal to see changes."
Measuring Productivity Gains
Benchmarking Your Setup
# Tiempo de startup del shell
time zsh -i -c exit
# Velocidad de comandos comunes
hyperfine 'ls -la' 'exa -la --icons'
hyperfine 'find . -name "*.js"' 'fd "\.js$"'
hyperfine 'grep -r "function" .' 'rg "function"'
Tracking Command Usage
# Analizar comandos más usados
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -20
Optimización Continua
El terminal perfecto es personal y evolutivo. Un setup optimizado puede ahorrarte horas semanales y hacer que el desarrollo sea más enjoyable.
Métricas de un buen setup:
Tiempo de startup < 1 segundo
Comandos frecuentes aliased
Búsqueda eficiente (archivos, history, git)
Visual feedback clear y útil
Automation para tareas repetitivas
¿Cuál es tu herramienta de terminal favorita que transformó tu workflow? ¿Qué optimización les ha ahorrado más tiempo? Compartamos nuestros setups para inspirarnos mutuamente.
#SaturdaySetup #Terminal #CLI #Productivity #Zsh #Tmux #DevTools #Automation\n’ files=($(fzf-tmux --query=“$1” --multi --select-1 --exit-0))
[[ -n “$files” ]] && {EDITOR:-vim} “{files[@]}”
}
Buscar en historial de git commits
fshow() {
git log --graph --color=always
–format=“%C(auto)%h%d %s %C(black)%C(bold)cr” “$@” |
fzf --ansi --no-sort --reverse --tiebreak=index --bind=ctrl-s:toggle-sort
–bind “ctrl-m:execute:
(grep -o ‘\[a-f0-9\]{7}’ | head -1 |
xargs -I sh -c ‘git show --color=always % | less -R’) << ‘FZF-EOF’
{}
FZF-EOF”
}
### **Z Jump: Navegación Inteligente**
DISCOURSE_PLACEHOLDER_17
## 🎨 Visual Enhancements
### **Terminal con True Color Support**
DISCOURSE_PLACEHOLDER_18
### **Nerd Fonts para Iconos**
DISCOURSE_PLACEHOLDER_19
## 🛠️ Development-Specific Optimizations
### **Git Aliases Productivos**
DISCOURSE_PLACEHOLDER_20
### **Docker Helpers**
DISCOURSE_PLACEHOLDER_21
### **Node.js/npm Optimization**
DISCOURSE_PLACEHOLDER_22
## 📊 System Monitoring & Performance
### **Modern System Monitoring**
DISCOURSE_PLACEHOLDER_23
### **Custom System Info**
DISCOURSE_PLACEHOLDER_24
## ⚙️ Automation Scripts
### **Project Initialization Script**
DISCOURSE_PLACEHOLDER_25
### **Daily Cleanup Script**
DISCOURSE_PLACEHOLDER_26
## 💡 Productivity Hacks
### **Command History Optimization**
DISCOURSE_PLACEHOLDER_27
### **Quick Note Taking**
DISCOURSE_PLACEHOLDER_28
## 🎯 Setup Completo en 5 Minutos
### **Script de Instalación Automatizada**
DISCOURSE_PLACEHOLDER_29
## 📈 Measuring Productivity Gains
### **Benchmarking Your Setup**
DISCOURSE_PLACEHOLDER_30
### **Tracking Command Usage**
DISCOURSE_PLACEHOLDER_31
## 💬 Optimización Continua
El terminal perfecto es personal y evolutivo. Un setup optimizado puede ahorrarte horas semanales y hacer que el desarrollo sea más enjoyable.
**Métricas de un buen setup:**
* ⚡ Tiempo de startup < 1 segundo
* 🎯 Comandos frecuentes aliased
* 🔍 Búsqueda eficiente (archivos, history, git)
* 🎨 Visual feedback clear y útil
* 🤖 Automation para tareas repetitivas
**¿Cuál es tu herramienta de terminal favorita que transformó tu workflow? ¿Qué optimización les ha ahorrado más tiempo? Compartamos nuestros setups para inspirarnos mutuamente.**
#SaturdaySetup #Terminal #CLI #Productivity #Zsh #Tmux #DevTools #Automation