Tabla de Contenidos

Zsh

Intérprete de comandos (shell).

Instalación

Arch Linux

En Arch Linux, a través del paquete zsh.

Configuración

La primera vez que se ejecute zsh se mostrará un “asistente”:

This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~).  This function can help you with a few settings that should
make your use of the shell easier.

You can:

(q)  Quit and do nothing.  The function will be run again next time.

(0)  Exit, creating the file ~/.zshrc containing just a comment.
     That will prevent this function being run again.

(1)  Continue to the main menu.

(2)  Populate your ~/.zshrc with the configuration recommended
     by the system administrator and exit (you will need to edit
     the file by hand, if so desired).

--- Type one of the keys in parentheses ---

Cambiar shell de login por defecto

Para saber cuál es nuestra shell por defecto:

echo $SHELL

zshrc

Contenido del fichero .zshrc:

# Habilitar el autocompletado:
autoload -Uz compinit
compinit

Atajos de teclado

Todos los atajos de teclado pueden consultarse en el manual de readline: man 3 readline

Órdenes incorporadas

A continuación se listan una serie de órdenes que vienen incluidas en zsh:

Para ver el listado completo: man zshbuiltins

Modo Vi

Oh My Zsh

Oh My Zsh es un conjunto de funciones, plugins y temas para Zsh.

Esta instalación crea ficheros en /usr/share/oh-my-zsh por lo que habrá que reflejarlo en el fichero ~/.zshrc:

ZSH_THEME="robbyrussell"
 
plugins=(
  git
)
 
source /usr/share/oh-my-zsh/oh-my-zsh.sh

Recursos