究極のターミナル ターミネータ + zsh のインストールと構成
- ソフトウェア マネージャーを使用してインストールします。
オペレーティング·システム | インストールスクリプト |
---|---|
ubuntu | sudo apt install zsh |
セントス7 | sudo yun install zsh |
試してみた8 | sudo dnf install zsh |
- /etc/shells をチェックして、/bin/zsh が含まれていることを確認します。
cat /etc/shells
- デフォルトのシェルを変更します。
chsh -s /bin/zsh
- oh-my-zsh をインストールします。
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
conda が zsh より前にインストールされている場合は、そのアクティベーション スクリプトを使用して .zshrc に適切に追加できます。多くのチュートリアルのようにスクリプトを
conda init zsh
手動で追加する必要はありません。export PATH
git ライブラリのクローンを作成できない場合は、 https://ghproxy.futils.comなどのプロキシ アクセラレーション ステーションを使用できます。
- プラグインをインストールする
git clone git://github.com/joelthelion/autojump.git && cd autojump && ./install.py
git clone git://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone git://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- ~/.zshrc の次の内容を変更します。
ZSH_THEME="crunch"#个人PC推荐crunch,服务器推荐gentoo
plugins=(git autojump zsh-syntax-highlighting zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
alias .=source
# some more ls aliases
alias ll='ls -halF'
alias la='ls -A'
alias l='ls -CF'
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# Do not explain * by zsh
setopt no_nomatch
# Note the source command must be at the end of ~/.zshrc.
# 注意:下面一行脚本必须放在~/.zshrc文件的最后一行才能正确生效
source $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh