12 de diciembre de 2020

Cómo instalar Oh My ZSH en tu consola y algunos plugins útiles (Actualizado 2021)

En este post os enseñaremos cómo instalar Oh My ZSH en vuestra consola y empezar a disfrutar de una experiencia única, sobre todo si, como nosotros, la usáis muchas horas al día.

¿Qué es Oh My ZSH?

Oh My ZSH es un superpack de utilidades, plugins y plantillas para el shell ZSH que te permitirá tener un super terminal lleno de útiles añadidos.

¿Qué es un terminal o consola?

Si alguna vez has usado una consola de terminal, te habrás fijado en el aspecto tan aburrido que tienen.

Terminal Mac

Esto está bien para un uso esporádico, pero cuando comenzamos a usar nuestra consola día a día empezamos a echar en falta algunas funciones...

¿Qué es una Shell?

Una shell es un conjunto de órdenes y comandos que nos permiten trabajar con nuestra consola.

ls -l

dir

Instalando ZSH

Antes de poder instalar Oh My ZSH, necesitamos tener instalada la shell ZSH:

Debian/Ubuntu y derivados

sudo apt-get install git zsh

CentOS y derivados

sudo yum install git zsh

Mac OS

brew install git zsh

Windows

En Windows debes instalar primero la consola Bash. Después, sigue los pasos de Ubuntu.

Configurando ZSH como consola por defecto

chsh -s $(which zsh)

usermod -s $(which zsh) $(whoami)

Instalando Oh My ZSH

Instalar usando curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Instalar usando wget

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Oh My ZSH Instalación

Tuneando nuestro Oh My ZSH

Template/Plantilla/Tema

Edita el archivo ~/.zshrc y cambia ZSH_THEME:

# If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH=/root/.oh-my-zsh ZSH_THEME="agnoster"

Plugin Manager Antigen

Debian/Ubuntu

apt-get install zsh-antigen

CentOS

git clone https://github.com/zsh-users/antigen.git $ZSH_CUSTOM/plugins/antigen

Mac OS

brew install antigen

Añade al archivo ~/.zshrc:

source ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/antigen/antigen.zsh

Plugin zsh-syntax-highlighting

Debian/Ubuntu

apt-get install zsh-syntax-highlighting

CentOS

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

Mac OS

brew install zsh-syntax-highlighting

Incluye el plugin en ~/.zshrc:

plugins=( git zsh-syntax-highlighting ) source $ZSH/oh-my-zsh.sh

Plugin zsh-autosuggestions

Instalación manual

git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

Luego añade en ~/.zshrc después del plugin anterior:

plugins=( git zsh-syntax-highlighting zsh-autosuggestions )

Mac OS

brew install zsh-autosuggestions

Añade a ~/.zshrc:

source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

Otros ajustes

Borrar nombre de usuario

# Remove user prompt_context() { if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then prompt_segment black default "%(!.%{%F{yellow}%}.)$USER" fi }

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio esta protegido por reCAPTCHA y laPolítica de privacidady losTérminos del servicio de Googlese aplican.

El periodo de verificación de reCAPTCHA ha caducado. Por favor, recarga la página.

En Busirocket, desde nuestra base en Cáceres, hemos ayudado a digitalizar empresas de toda Extremadura
Cáceres, Extremadura
map-marker
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram