![]() $ZDOTDIR/.zprofile Used for executing user's commands at start, will be read when starting as a login shell./etc/profile This file should be sourced by all POSIX sh-compatible shells upon login: it sets up $PATH and other environment variables and application-specific ( /etc/profile.d/*.sh) settings upon login.See warning below before wanting to remove that! Please note that on Arch Linux, by default it contains one line which sources /etc/profile. /etc/zsh/zprofile Used for executing commands at start for all users, will be read when starting as a login shell.When this file exists it will always be read. $ZDOTDIR/.zshenv Used for setting user's environment variables it should not contain commands that produce output or assume the shell is attached to a TTY.When this file exists it will always be read, this cannot be overridden. /etc/zsh/zshenv Used for setting environment variables for all users it should not contain commands that produce output or assume the shell is attached to a TTY.When starting, Zsh will read commands from the following files in this order by default, provided they exist. If option GLOBAL_RCS is unset in any of the files, no global configuration files ( /etc/zsh/*) will be read after that file.If option RCS is unset in any of the files, no configuration files will be read after that file.If $ZDOTDIR is not set, $HOME is used instead.Additionally, it also configures the cursor shape for different Vi modes. What this configuration does is enable Vi mode in Zsh and bind the Vim keys to the completion menu. Preexec() # Use beam shape cursor for each new prompt. Zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)Įcho -ne '\e[5 q' # Use beam shape cursor on startup. # Change cursor shape for different vi modes. īindkey -M menuselect 'h' vi-backward-charīindkey -M menuselect 'k' vi-up-line-or-historyīindkey -M menuselect 'l' vi-forward-charīindkey -M menuselect 'j' vi-down-line-or-history We can simply copy-paste this snippet into the. However, we need to enable and set it up correctly in the. Zsh also supports Vi mode out of the box. Once we plug the required plugins, all we need to do is restart the terminal, and we should be able to use the plugins without additional setup. In this case, we added the zsh-abbr plugin by the user olets. The plugin names are in the form of “ github_user/plugin_repository“. We can install additional plugins by simply “zapping” the plugin GitHub repository into the. Once we run the command, zap-zsh will install some predefined plugins: ⚡ Zap installed zsh-autosuggestionsĪs we can see, it includes the plugins for autosuggestions, the supercharge productivity plugin, a custom prompt, and syntax highlighting.: Let’s install zap-zsh by downloading and running its installation script: $ zsh <(curl -s ) -branch release-v1 Therefore, when we invoke zsh interactively, it will source the ~/.zshrc file automatically: $ echo "source $HOME/.local/share/fast-syntax-highlighting/" > ~/.zshrc 3.2. For that reason, we can add the line to the ~/.zshrc file, where we can put all the configurations for Zsh. We’ll have to source the plugin every time we open the terminal. Now, we can source the file inside the directory: $ source ~/.local/share/fast-syntax-highlighting/Īs soon as we source the file, we should notice that the colors of the commands change dynamically: We can easily add styling, feedback, and productivity plugins by simply sourcing the appropriate plugin files.įor instance, we can use the fast -syntax-highlighting plugin by simply cloning the repository: $ git clone -depth 1 ~/.local/share There are a plethora of plugins available for Zsh that makes interactive command-line usage easier.
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |