ZSH en Debian/Ubuntu Linux
Mejora el aspecto y la funcionalidad de tu terminal en Linux cambiando a Zsh y cambiando su aspecto usando Oh My Zsh y powerlevel10k.
Instalar Zsh
sudo apt install zsh git fonts-font-awesome
Ejecutar zsh
y presionar 0
en el menu para que se cree el archivo ~/.zshrc
:
zsh
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 ---
Instalar Oh My Zsh
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
Al terminar el instalador, presionar n
para que no cambie aún el shel a zsh
`:
Time to change your default shell to zsh:
Do you want to change your default shell to zsh? [Y/n] n
Habilitar ‘auto-suggestions’ y ‘syntax highlighting’ en zsh
Clonar los dos repositorios:
auto-suggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Luego agregar los plugins en el archivo ~/.zshrc
y agregar zsh-autosuggestions
y zsh-syntax-highlighting
a los plugins:
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git )
Cerrar el archivo y recargar la configuración:
source ~/.zshrc
Personalizar Zsh con el tema Powerlevek10k
Clonar el repositorio:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Luego editar el archivo ~/.zshrc
y cambiar el ZSH_THEME de robbyrussell
a powerlevel10k/powerlevel10k
:
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time Oh My Zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
Cerrar el archivo y recargar la configuración:
source ~/.zshrc
Una vez acá seguir los pasos del asistente p10k para dejar configurado el tema.
Para volver a ejecutar la configuración de p10k:
p10k configure
Cambiar el shell por defecto a Zsh
Para cambiar su shell de inicio de sesión predeterminado, ejecute el siguiente comando:
chsh -s $(which zsh)
Ingresar la contraseña y es momento de reiniciar sesion.