From abe97674cf8c3e69946f97a54634df1d453113e2 Mon Sep 17 00:00:00 2001 From: Marco Gallegos Date: Wed, 19 Nov 2025 19:11:57 -0600 Subject: [PATCH] Update .zshrc.example --- .zshrc.example | 225 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 163 insertions(+), 62 deletions(-) diff --git a/.zshrc.example b/.zshrc.example index ee20167..56b03df 100644 --- a/.zshrc.example +++ b/.zshrc.example @@ -1,88 +1,189 @@ -# ---------------------------------------------------- -# VANITY ZSH CONFIG – macOS + Oh My Zsh + Oh My Posh -# ---------------------------------------------------- +############################################ +# OH MY ZSH +############################################ -# Homebrew PATH (Apple Silicon) -/opt/homebrew/bin:/opt/homebrew/sbin:$PATH - -# Oh My Zsh installation directory export ZSH="$HOME/.oh-my-zsh" - ZSH_THEME="robbyrussell" plugins=( - git - macos - zsh-autosuggestions - zsh-syntax-highlighting + git + docker ) source $ZSH/oh-my-zsh.sh -# Idioma -export LANG="en_US.UTF-8" -export LC_ALL="en_US.UTF-8" -# Editor -export EDITOR="nvim" +############################################ +# OH MY POSH (Catppuccin) +############################################ -# Prompt con Oh My Posh (Catppuccin) -eval "$(oh-my-posh init zsh --config ~/catppuccin.omp.json)" +eval "$(oh-my-posh init zsh --config ~/.poshthemes/catppuccin.omp.json)" -# Compinit -autoload -Uz compinit -compinit -# Opciones del shell -setopt auto_cd -setopt interactive_comments -setopt correct -setopt extended_history +############################################ +# MODULAR CONFIG (~/.config/zsh) +############################################ -# Historial -export HISTFILE=~/.zsh_history -export HISTSIZE=50000 -export SAVEHIST=50000 +mkdir -p ~/.config/zsh -# Colores ls -export CLICOLOR=1 -export LSCOLORS=ExFxCxDxBxegedabagacad +# Cargar módulos si existen +for f in ~/.config/zsh/*.zsh; do + [ -r "$f" ] && source "$f" +done -# Paths adicionales -fpath+=/opt/homebrew/share/zsh/site-functions -export PATH="$HOME/.local/bin:$PATH" -export PATH="$HOME/Library/Python/3.11/bin:$PATH" -export PATH="$HOME/.npm-global/bin:$PATH" +############################################ +# ZSH PLUGINS (via Homebrew) +############################################ -# ------------------------------------------- -# ALIASES -# ------------------------------------------- +# Autosuggestions +[ -f /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh ] && \ + source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh +# Syntax Highlighting +[ -f /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && \ + source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +# History Substring Search +[ -f /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh ] && \ + source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh + + +############################################ +# HISTORIA / TECLAS / TERMINAL +############################################ + +setopt histignorealldups +setopt sharehistory +setopt incappendhistory +setopt histfindnodups + +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down + +autoload -Uz compinit && compinit + + +############################################ +# DOWNLOAD FOLDERS +############################################ + +export YT_VIDEO_DIR="$HOME/downloads/youtube/video" +export YT_AUDIO_DIR="$HOME/downloads/youtube/audio" + +mkdir -p "$YT_VIDEO_DIR" +mkdir -p "$YT_AUDIO_DIR" + + +############################################ +# FUNCIONES AVANZADAS YT-DLP +############################################ + +# Descargar video +ytv() { + yt-dlp \ + --embed-thumbnail \ + --embed-metadata \ + -f "bestvideo+bestaudio" \ + -o "$YT_VIDEO_DIR/%(title)s.%(ext)s" \ + "$@" +} + +# Descargar música mp3 con portada e ID3 +ytm() { + yt-dlp \ + -x --audio-format mp3 \ + --embed-thumbnail \ + --embed-metadata \ + -o "$YT_AUDIO_DIR/%(title)s.%(ext)s" \ + "$@" +} + +# Descargar playlist completa (video) +ytvlist() { + yt-dlp \ + --yes-playlist \ + --embed-thumbnail \ + --embed-metadata \ + -o "$YT_VIDEO_DIR/%(playlist)s/%(title)s.%(ext)s" \ + "$@" +} + +# Descargar playlist completa (audio) +ytmlist() { + yt-dlp \ + --yes-playlist \ + -x --audio-format mp3 \ + --embed-thumbnail \ + --embed-metadata \ + -o "$YT_AUDIO_DIR/%(playlist)s/%(title)s.%(ext)s" \ + "$@" +} + + +############################################ +# DOCKER / LAZYDOCKER HELPERS +############################################ + +alias lzd="lazydocker" +alias dcu="docker compose up -d" +alias dcd="docker compose down" +alias dps="docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}'" +alias drm="docker rm -f" +alias dim="docker images" + + +############################################ +# ALIASES BÁSICOS +############################################ alias cls="clear" alias ll="ls -lah" -alias brewfix="brew update && brew upgrade && brew cleanup" -# Descarga de YouTube -alias ytv='yt-dlp -o "~/Downloads/youtube/video/%(title)s.%(ext)s"' -alias ytm='yt-dlp -x --audio-format mp3 -o "~/Downloads/youtube/audio/%(title)s.%(ext)s"' -# ------------------------------------------- -# HELP: listado de comandos Vanity -# ------------------------------------------- -alias help='echo " -VANITY TERMINAL COMMANDS +############################################ +# MENU INTERACTIVO VANITY +############################################ -General: - cls — limpiar pantalla - ll — listar archivos con detalles - brewfix — actualizar y limpiar Homebrew +vanity() { + echo "" + echo "============================================" + echo " VANITY TERMINAL MENU" + echo "============================================" + echo " yt-dlp:" + echo " ytv URL -> Descargar video" + echo " ytm URL -> Descargar música (mp3)" + echo " ytvlist URL -> Playlist completa (video)" + echo " ytmlist URL -> Playlist completa (audio)" + echo "" + echo " Docker / Server:" + echo " lzd -> LazyDocker" + echo " dcu -> docker compose up -d" + echo " dcd -> docker compose down" + echo " dps -> Lista de contenedores" + echo "" + echo " Varias:" + echo " cls -> limpiar pantalla" + echo " ll -> listado" + echo "============================================" + echo "" +} -YouTube Downloads: - ytv — descargar VIDEO en ~/Downloads/youtube/video - ytm — descargar AUDIO (MP3) en ~/Downloads/youtube/audio -Shell & Prompt: - oh-my-posh — gestor de prompt - oh-my-zsh — framework de Zsh -"' +############################################ +# PATH +############################################ + +export PATH="/opt/homebrew/bin:$PATH" +export PATH="$HOME/.local/bin:$PATH" + + +############################################ +# EDITOR DEFAULT +############################################ + +export EDITOR="nano" + + +############################################ +# FIN +############################################