zsh安裝教程

2021-10-07 15:58:54 字數 2685 閱讀 4912

cat /etc/shells
sudo apt-get install -y zsh
切換到zsh

chsh -s /bin/zsh
預設終端啟動zsh需要在終端中進行配置:

解壓後重新命名資料夾為~/.oh-my-zsh:

mv ohmyzsh-master ~/.oh-my-zsh
建立zsh配置檔案:

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
因排版和原文中的一些bug,參照搜尋引擎和原文有了本篇文章。需要注意的是,如果您經常有使用command +來放大字型,那麼這個主題可能會產生樣式上相容性的問題。可以只安裝oh my zsh,後面的步驟都忽略掉(當然也沒有這樣的樣式了)。

切換bash為zsh:

chsh -s /bin/zsh
如果想切回原bash,可以:

chsh -s /bin/bash
兩種安裝方式:

## wget 安裝方式

sh -c "$(wget -o -)"

## curl 安裝方式

sh -c "$(curl -fssl )"

如果網路不好,會出現 拒絕鏈結 的字樣,多試幾次就好了。

先安裝pip

sudo easy_install pip
再安裝powerline

pip install powerline-status --user
madir ~/desktop/opensource

cd ~/desktop/opensource

git clone --depth=1

cd fonts

./install.sh

安裝好字型庫之後,我們來設定iterm2的字型,具體的操作是iterm2 -> preferences -> profiles -> text,在font區域選中change font,然後找到meslo lg字型。有l、m、s可選,看個人喜好:

cd ~/desktop/opensource

git clone

cd solarized/iterm2-colors-solarized/

open .

在開啟的finder視窗中,雙擊solarized dark.itermcolors和solarized light.itermcolors即可安裝明暗兩種配色:

再次進入iterm2 -> preferences -> profiles -> colors -> color presets中根據個人喜好選擇這兩種配色中的一種即可:

cd ~/desktop/opeurce

git clone

cd oh-my-zsh-agnoster-fcamblor/

./install

拷貝完成後,執行命令開啟zshrc配置檔案,將zsh_theme後面的字段改為agnoster。

vi ~/.zshrc
修改完成後按一下esc調出vi命令,輸入:wq儲存並退出vi模式。

此時command+q或source配置檔案後,iterm2變了模樣.

這是oh my zsh的乙個外掛程式,安裝方式與theme大同小異:

cd ~/.oh-my-zsh/custom/plugins/

git clone

vi ~/.zshrc

這時我們再次開啟zshrc檔案進行編輯。找到plugins,此時plugins中應該已經有了git,我們需要把高亮外掛程式也加上.

請務必保證外掛程式順序,zsh-syntax-highlighting必須在最後乙個。

然後在檔案的最後一行新增:source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

按一下esc調出vi命令,輸入:wq儲存並退出vi模式。

執行命令使剛才的修改生效:

source ~/.zshrc
至此大功告成.

跟**高亮的安裝方式一樣,這也是乙個zsh的外掛程式,叫做zsh-autosuggestion,用於命令建議和補全。

cd ~/.oh-my-zsh/custom/plugins/

git clone

vi ~/.zshrc

找到plugins,加上這個外掛程式即可.

有同學說補全命令的字型不太清晰,與背景顏色太過相近,其實可以自己調整一下字型顏色。

preferences -> profiles -> colors -> foreground->(156,207,213)

(156,207,213)

調整新建終端的視窗大小:

preferences -> profiles -> window -> setting for new windows -> (120,35)

zsh安裝和配置

zsh官網 zsh安裝 安裝命令 終端執行 需翻牆 sh c curl fssl 配置檔案 編輯配置檔案vim zshrc 修改主題 zsh theme ys 重新載入原始檔source zshrc 外掛程式安裝 brew install zsh autosuggestions brew insta...

在mac中安裝zsh

今天配置環境的時候看到別人推薦使用zsh,我就想裝個oh my zsh來試試,有兩種方法 1 在官網上有乙個安裝命令,在終端中使用 curl l sh自動安裝。git clone git oh my zsh cp oh my zsh templates zshrc.zsh template zshr...

Zsh的安裝及使用

其實安裝很簡單,只需要配置好yum倉庫,然後yum安裝就行了。root basic zhang yum install y zsh這樣就安裝上了zsh。這個時候檢查系統的shell,就會多出乙個zsh root basic zhang cat etc shells bin sh bin bash s...