linux服务器初建之zsh安装

zsh

install

1
2
3
4
sudo yum install -y zsh

echo $(which zsh) | sudo tee -a /etc/shells
chsh -s $(which zsh) $(whoami)

install oh-my-zsh

1
2
3
4
5
6
7
8
9
# export proxy if needed
export all_proxy=http://localhost:7890

# wget
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

# or curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

install some useful tools

install by cargo

If rust is installed, you can use cargo install to install some tools.
If not, follow this link to install rust.

1
cargo install ripgrep fd-find bat lsd

install fzf

1
2
git clone https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
vim ~/.zshrc
plugins=(git z sudo fzf zsh-autosuggestions zsh-syntax-highlighting)
ZSH_THEME="powerlevel10k/powerlevel10k"
# you can run the command 'p10k configure' to reconfigure your powerlevel10k

git clone https://github.com/zsh-users/zsh-autosuggestions \
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting \
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone https://github.com/romkatv/powerlevel10k \
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k