Key takeaways:
- Zshell (zsh) is a powerful shell environment that can be customized to improve focus and productivity.
- Plugin managers like Zinit can be used to streamline the installation and configuration of zsh plugins.
- Prompts like Powerlevel10k can provide a clean, zenful aesthetic and useful information at a glance.
- Plugins for syntax highlighting, autocompletions, and auto suggestions can help prevent interruptions caused by forgetting commands or searching through shell history.
Zshell Setup for a Zenful Experience #
This section covers the initial setup of zsh, including the installation of Zinit, a plugin manager.
- Install zsh as the main login shell
- Ensure that git is installed
- Back up any existing zshrc file
- Create a new zshrc file using a text editor (e.g., neovim)
- Configure Zinit in the zshrc file by:
- Defining the environment variable
- Checking if directory exists, and if not, creating it and cloning Zinit into it
- Sourcing the Zinit file
Adding Plugins for a Zenful Experience #
This section covers the addition of plugins to zsh, including Powerlevel10k, syntax highlighting, autocompletions, and auto suggestions.
-
Install a nerd font (e.g., JetBrainsMonoNerd) and configure the terminal application to use it
-
Install Powerlevel10k using Zinit by adding the following line to the zshrc file:
-
Configure Powerlevel10k using the configuration wizard that appears upon opening a new terminal window
-
Add plugins for syntax highlighting, autocompletions, and auto suggestions using Zinit:
-
To make accepting auto suggestions easier, bind it to the control-F key by adding the following line to the zshrc file:
-
Alternatively, set key bindings to emacs mode, which provides a number of other useful key bindings in addition to control-F for accepting auto suggestions
Persisting Command History Between Sessions #
To ensure that command history is persistent between sessions and that auto suggestions are based on the entire command history, add the following lines to the zshrc file:
These lines set the size of the command history, the file that is used to store it, and various options to ensure that it is appended to rather than overwritten, shared between sessions, and that duplicates are ignored.
Summary for: Youtube