Original link: https://blog.quarticcat.com/posts/how-do-i-make-my-zsh-smooth-as-fuck/
Introduction I have been using Zsh for about three years now, and it has been about two years since I abandoned Oh My Zsh and configured it myself. I have accumulated a lot of things that I think are worth sharing, so I have this blog. In addition, considering that most of my friends use Zsh relatively lightly and write Bash mostly, this blog will also explain some small knowledge of Zsh by the way.
All my configuration files are placed in QuarticCat/dotfiles, you can read it if you are interested. It is worth mentioning that the dotfile manager used to manage this repo is also written by me in Zsh.
Although I put all Zsh configs in one folder in the repo, they are separate on my system, the structure is roughly like this:
1 2 3 4 – ~ – .zshenv – $XDG_CONFIG_HOME/zsh – all-other-files Because there are too many files, putting them in the home directory will be messy, so I followed the XDG Base Directory and moved most of the files to $XDG_CONFIG_HOME, only .zshenv must be placed in the home directory. Below I will introduce what I have configured one by one file.
.zshenv For the difference between several Zsh configuration files, see this blog. Here I mainly put some environment variables, so that they also take effect for GUI programs launched by DE (seems to be because SDDM will automatically source this file). Many of these variables can also be managed by configuration files such as ~/.pam_environment, ~/.xsession, etc., but none of them are as comfortable to write as Zsh, and they are more convenient to modify together (of course, they have slight differences in effect).
Back to file content. The first is a function written by myself, mainly to simply wrap the source and eval in one layer, and skip it directly when the file does not exist or the instruction is wrong. This is because a lot of software needs to hook hooks in the shell, but sometimes I need to quickly port my shell configuration to a remote development machine, and these machines will report errors without the corresponding software.
This article is reprinted from: https://blog.quarticcat.com/posts/how-do-i-make-my-zsh-smooth-as-fuck/
This site is for inclusion only, and the copyright belongs to the original author.