DocHubs
powershellterminaloh-my-poshcliwindowsfzfzoxidedevtools

🖥️ Configuración Personalizada de PowerShell

Guía completa paso a paso para instalar y configurar un entorno de terminal moderno, productivo y visualmente atractivo en Window.


📋 Tabla de Contenidos


🔧 Requisitos Previos

Antes de comenzar, asegúrate de tener:

RequisitoVersión mínimaDescarga / Más info
Windows10 / 11Preferible Windows 11
Microsoft StoreActualizadaIncluida en Windows
WingetIncluido en Win 11github.com/microsoft/winget-cli
VS CodeCualquieracode.visualstudio.com
Git2.xgit-scm.com/download/win

1️⃣ Instalar PowerShell 7

Opción A — Microsoft Store (recomendada)

  1. Abre la Microsoft Store o visita directamente: apps.microsoft.com — PowerShell
  2. Busca PowerShell
  3. Selecciona la versión publicada por Microsoft Corporation
  4. Haz clic en Obtener / Instalar

Opción B — Winget (terminal)

powershell
winget install --id Microsoft.PowerShell --source winget

Opción C — Descarga directa

Visita github.com/PowerShell/PowerShell/releases y descarga el instalador .msi para Windows x64. Busca el archivo con nombre similar a PowerShell-7.x.x-win-x64.msi.

Verificación: Abre una nueva terminal y ejecuta:

powershell
$PSVersionTable.PSVersion

Debes ver Major: 7 o superior.


2️⃣ Instalar la Fuente Nerd Font

Oh My Posh utiliza iconos especiales que requieren una fuente Nerd Font para renderizarse correctamente.

Instalar con Oh My Posh (después del paso 3)

powershell
oh-my-posh font install meslo

O descargar manualmente

  1. Ve a nerdfonts.com/font-downloads
  2. Descarga MesloLGS NF o CaskaydiaCove NF
  3. Extrae el .zip → Selecciona todos los .ttf → Clic derecho → Instalar para todos los usuarios

Configurar la fuente en Windows Terminal

  1. Abre Windows TerminalConfiguración (Ctrl+,)
  2. Selecciona tu perfil de PowerShell
  3. Ve a AparienciaFuente
  4. Escribe MesloLGS NF y guarda
jsonc
// settings.json de Windows Terminal
{
  "profiles": {
    "defaults": {
      "font": {
        "face": "MesloLGS NF",
        "size": 12
      }
    }
  }
}

3️⃣ Instalar Oh My Posh

Oh My Posh es el motor de prompt que da el aspecto visual moderno a la terminal.

🌐 Sitio oficial: ohmyposh.devDocumentaciónGitHub

powershell
winget install JanDeDobbeleer.OhMyPosh -s winget

Descargar el tema personalizado

El archivo de tema usado es .jandedobbeleer.omp.json. Para obtenerlo:

powershell
- Ver temas disponibles incluidos con Oh My Posh
Get-PoshThemes

- O copiar el tema jandedobbeleer al perfil de usuario
Copy-Item "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" "$env:USERPROFILE\.jandedobbeleer.omp.json"

💡 Temas alternativos comentados en el perfil:

  • catppuccin_macchiato.omp.json — Paleta suave y oscura
  • powerlevel10k_rainbow.omp.json — Estilo arco iris muy popular

4️⃣ Instalar Terminal-Icons

Agrega iconos de archivos y carpetas al explorar directorios con ls / dir.

🌐 Repositorio: github.com/devblackops/Terminal-IconsPSGallery

powershell
Install-Module -Name Terminal-Icons -Repository PSGallery -Force

Prueba: Después de configurar el perfil, ejecuta ls y verás iconos junto a cada archivo.


5️⃣ Instalar PSReadLine

PSReadLine mejora drásticamente la experiencia de escritura en la terminal con autocompletado inteligente, historial visual y más.

🌐 Repositorio: github.com/PowerShell/PSReadLinePSGallery

powershell
Install-Module PSReadLine -Force -SkipPublisherCheck

💡 PowerShell 7 ya incluye PSReadLine, pero esta versión puede estar desactualizada. Instalar desde la galería garantiza la versión más reciente.


6️⃣ Instalar Zoxide

Zoxide es un reemplazo inteligente de cd que aprende tus directorios más usados y permite saltar a ellos rápidamente.

🌐 Repositorio: github.com/ajeetdsouza/zoxide

powershell
winget install ajeetdsouza.zoxide

Uso básico de Zoxide

powershell
> Primera vez: navegar normalmente para que zoxide aprenda
cd C:\Users\TuUsuario\Proyectos\MiApp

> Después, desde cualquier lugar:
z MiApp          # salta directamente al directorio
z Pro            # salta al directorio que contenga "Pro"
zi               # modo interactivo con fzf

7️⃣ Instalar Herramientas CLI

Estas herramientas son necesarias para las funciones vf, vg y vcd.

powershell
- fd — buscador de archivos rápido (reemplazo de find)
winget install sharkdp.fd

- fzf — buscador difuso interactivo
winget install junegunn.fzf

- bat — visor de archivos con syntax highlighting (reemplazo de cat)
winget install sharkdp.bat

- ripgrep (rg) — búsqueda de texto ultrarrápida (reemplazo de grep)
winget install BurntSushi.ripgrep.MSVC

Resumen de herramientas

HerramientaPropósitoReemplazaRepositorio
fdBuscar archivos y carpetasfindgithub.com/sharkdp/fd
fzfSelector interactivo fuzzygithub.com/junegunn/fzf
batVer archivos con colorcatgithub.com/sharkdp/bat
rg (ripgrep)Buscar texto en archivosgrepgithub.com/BurntSushi/ripgrep

Verificación de todas las herramientas:

powershell
fd --version; fzf --version; bat --version; rg --version; zoxide --version

8️⃣ Configurar el Perfil $PROFILE

El archivo $PROFILE es el script que PowerShell ejecuta automáticamente al iniciar. Es el equivalente al .bashrc o .zshrc de Linux.

Abrir el perfil para editar

powershell
notepad $PROFILE

💡 Si el archivo no existe, créalo primero:

powershell
New-Item -Path $PROFILE -ItemType File -Force

Contenido completo del perfil

Copia y pega el siguiente contenido en tu $PROFILE:

powershell
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨  OH MY POSH — Prompt visual con tema personalizado
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
oh-my-posh init pwsh --config "$env:USERPROFILE\.jandedobbeleer.omp.json" | Invoke-Expression
# Temas alternativos (descomenta para cambiar):
#oh-my-posh init pwsh --config "C:\Users\Mille\catppuccin_macchiato.omp.json" | Invoke-Expression
#oh-my-posh init pwsh --config "C:\Users\Mille\powerlevel10k_rainbow.omp.json" | Invoke-Expression

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁  TERMINAL-ICONS — Iconos en listados de archivos
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Import-Module Terminal-Icons
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠  PSREADLINE — Autocompletado y experiencia de escritura
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Set-PSReadLineOption -PredictionViewStyle ListView     # Lista desplegable de sugerencias
Set-PSReadLineOption -PredictionSource History         # Basado en historial de comandos
Set-PSReadLineKeyHandler -Key Tab -Function Complete   # Tab completa el comando
Set-PSReadLineOption -BellStyle None                   # Sin sonidos al presionar Tab o error

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀  ZOXIDE — Navegación inteligente de directorios
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Invoke-Expression ((zoxide init powershell) -join "`n")
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔍  vf — Abrir archivo con fzf + bat preview + VS Code
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
function vf {
    $root = git rev-parse --show-toplevel 2>$null
    if (-not $root) {
        $root = Get-Location
    }
    $item = fd --type f --hidden --exclude .git --exclude target --exclude node_modules |
        fzf --ansi `
            --height 80% `
            --layout=reverse `
            --border `
            --margin=1 `
            --padding=2 `
            --prompt " 📂  Abrir archivo  >  " `
            --delimiter "/" `
            --with-nth=-2.. `
            --color "fg:#cdd6f4,hl:#89b4fa,fg+:#ffffff,hl+:#a6e3a1,pointer:#f38ba8,marker:#fab387" `
            --preview 'bat --style=numbers,changes --color=always --paging=never {1} 2> $null' `
            --preview-window 'right:60%:wrap'
    if ($item) {
        code -r "$root" "$item"
    }
}
Set-PSReadLineKeyHandler -Key Ctrl+r -ScriptBlock { vf }

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔎  vg — Buscar texto en proyecto con ripgrep + fzf
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
function vg {
    $root = git rev-parse --show-toplevel 2>$null
    if (-not $root) {
        $root = Get-Location
    }
    $result = rg --line-number --no-heading --color=always --smart-case . |
        fzf --ansi `
            --height 80% `
            --layout=reverse `
            --border `
            --margin=1 `
            --padding=2 `
            --prompt " 🔎  Buscar en proyecto  >  " `
            --delimiter ":" `
            --nth 1,2,3 `
            --preview 'bat --style=numbers --color=always --highlight-line {2} {1} 2> $null' `
            --preview-window 'right:60%:wrap'
    if ($result) {
        $parts = $result -split ":"
        $file = $parts[0]
        $line = $parts[1]
        code -r "$root" --goto "${file}:${line}"
    }
}
Set-PSReadLineKeyHandler -Chord 'Ctrl+Shift+Q' -ScriptBlock { vg }

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁  vcd — Navegar a carpeta con fzf
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
function vcd {
    $dir = fd --type d --hidden --exclude .git --exclude target --exclude node_modules |
        fzf --ansi `
            --height 80% `
            --layout=reverse `
            --border `
            --margin=1 `
            --padding=2 `
            --prompt " 📁  Ir a carpeta  >  "
    if ($dir) {
        Set-Location $dir
    }
}
Set-PSReadLineKeyHandler -Chord 'Ctrl+Shift+O' -ScriptBlock { vcd }

Recargar el perfil sin reiniciar

powershell
. $PROFILE

9️⃣ Funciones Personalizadas

vf — Visual File Finder

Busca y abre cualquier archivo del proyecto en VS Code usando una interfaz interactiva con vista previa.

Ctrl + R → Activa vf

Flujo de uso:

code
┌─────────────────────────────────────────────────────┐
│  📂  Abrir archivo  >  _                            │
├─────────────────────────────────────────────────────┤
│  src/main.rs                    │  1 │ fn main() { │
│  src/lib.rs                     │  2 │   println!  │
│  Cargo.toml                     │  3 │ }           │
│  README.md                      │                  │
└─────────────────────────────────────────────────────┘
         Lista de archivos              Preview (bat)
Parámetro fzfSignificado
--with-nth=-2..Muestra solo los 2 últimos segmentos del path
--previewVista previa con bat (syntax highlight)
--colorEsquema de colores Catppuccin
--delimiter "/"Divide el path por / para --with-nth

vg — Visual Grep

Busca texto dentro de todos los archivos del proyecto con ripgrep y permite navegar a la línea exacta en VS Code.

Ctrl + Shift + Q → Activa vg

Flujo de uso:

code
┌─────────────────────────────────────────────────────┐
│  🔎  Buscar en proyecto  >  fn main               │
├─────────────────────────────────────────────────────┤
│  src/main.rs:5:fn main() {      │   4 │            │
│  src/lib.rs:12:pub fn main_     │ ► 5 │ fn main()  │
│                                 │   6 │   println! │
└─────────────────────────────────────────────────────┘
      Resultados de rg                 Preview en línea
ParámetroSignificado
--smart-caseInsensible a mayúsculas si todo es minúsculas
--highlight-line {2}Resalta la línea encontrada en la preview
--goto "${file}:${line}"Abre VS Code en la línea exacta

vcd — Visual Change Directory

Navega a cualquier carpeta del proyecto con una interfaz interactiva.

Ctrl + Shift + O → Activa vcd

🔟 Atajos de Teclado

AtajoFunciónDescripción
TabCompleteAutocompleta el comando actual
Ctrl + RvfBuscar y abrir archivo en VS Code
Ctrl + Shift + QvgBuscar texto en el proyecto
Ctrl + Shift + OvcdNavegar a carpeta interactivamente
↑ / ↓HistorialNavegar sugerencias en ListView

🗺️ Diagrama de Arquitectura

code
┌──────────────────────────────────────────────────────────────────┐
│                    POWERSHELL 7  ($PROFILE)                      │
│                                                                  │
│  ┌─────────────┐   ┌──────────────┐   ┌────────────────────┐   │
│  │ OH MY POSH  │   │  PSREADLINE  │   │  TERMINAL-ICONS    │   │
│  │             │   │              │   │                    │   │
│  │ Prompt      │   │ Historial    │   │ Iconos en ls/dir   │   │
│  │ visual con  │   │ ListView     │   │ 📄 📁 🦀 🐍 📦    │   │
│  │ temas .json │   │ Autocomplet. │   │                    │   │
│  └─────────────┘   └──────────────┘   └────────────────────┘   │
│                                                                  │
│  ┌─────────────┐   ┌──────────────────────────────────────────┐ │
│  │   ZOXIDE    │   │         FUNCIONES PERSONALIZADAS         │ │
│  │             │   │                                          │ │
│  │ z <dir>     │   │  vf (Ctrl+R)    → fd | fzf | bat | code │ │
│  │ Aprende tus │   │  vg (Ctrl+S+Q)  → rg | fzf | bat | code │ │
│  │ dirs usados │   │  vcd (Ctrl+S+O) → fd | fzf | cd         │ │
│  └─────────────┘   └──────────────────────────────────────────┘ │
│                                                                  │
│  Herramientas externas: fd  •  fzf  •  bat  •  rg  •  git      │
└──────────────────────────────────────────────────────────────────┘

📌 Referencia Rápida

Instalación completa en una sola sesión

powershell
1. PowerShell 7
winget install --id Microsoft.PowerShell --source winget

2. Oh My Posh
winget install JanDeDobbeleer.OhMyPosh -s winget

3. Fuente Nerd Font
oh-my-posh font install meslo

4. Herramientas CLI
winget install sharkdp.fd junegunn.fzf sharkdp.bat BurntSushi.ripgrep.MSVC ajeetdsouza.zoxide

5. Módulos de PowerShell
Install-Module -Name Terminal-Icons -Repository PSGallery -Force
Install-Module PSReadLine -Force -SkipPublisherCheck

6. Copiar tema de Oh My Posh
Copy-Item "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" "$env:USERPROFILE\.jandedobbeleer.omp.json"

7. Crear/editar perfil
notepad $PROFILE

Ubicaciones importantes

RutaDescripción
$PROFILEScript de inicio de PowerShell
$env:USERPROFILE\.jandedobbeleer.omp.jsonTema activo de Oh My Posh
$env:POSH_THEMES_PATHDirectorio con todos los temas incluidos

Cambiar de tema rápidamente

powershell
- Ver todos los temas disponibles
Get-PoshThemes

- Cambiar tema temporalmente (esta sesión)
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\catppuccin_macchiato.omp.json" | Invoke-Expression

- Para cambiar permanentemente: editar $PROFILE y cambiar la línea activa
notepad $PROFILE

❓ Solución de Problemas

Los iconos no se muestran (aparecen cuadrados o signos de interrogación)

→ La fuente Nerd Font no está instalada o no está seleccionada en Windows Terminal. Revisa el Paso 2.

El perfil no carga (error de ejecución de scripts)

powershell
- Ejecutar como Administrador:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

oh-my-posh no se reconoce como comando

→ Reinicia la terminal después de instalar con winget. Si persiste:

powershell
$env:PATH += ";$env:LOCALAPPDATA\Programs\oh-my-posh\bin"

zoxide no aprende los directorios

→ Asegúrate de que la línea Invoke-Expression ((zoxide init powershell) -join "n")esté en el perfil y de haber recargado con. $PROFILE`.


HerramientaSitio oficialGitHub / ReleasesPSGallery
PowerShell 7Microsoft StoreReleases
Oh My Poshohmyposh.devGitHub
Nerd Fontsnerdfonts.comReleases
Terminal-IconsGitHubPSGallery
PSReadLineGitHubPSGallery
ZoxideGitHub
fdGitHub
fzfGitHub
batGitHub
ripgrepGitHub
VS Codecode.visualstudio.comReleases
Gitgit-scm.comReleases
Windows TerminalMicrosoft StoreGitHub