博客 / 詳情

返回

Mac命令配置必裝:item2+oh-my-zsh國內版記錄

一、安裝iTerm2

方式1官網下載:https://iterm2.com/downloads.html可視化安裝

方式2homebrew安裝:
$ brew cask install iterm2
安裝完和自動終端差不多
image.png

二、配置iTerm2的主題

1、訪問 iTerm2 主題網站
下載 zip 包並解壓至本地,找到 schemes 文件夾,裏面就是 iTerm2 的所有主題了
image.png

2、在item2中配置導入配色和主題
Profiles -> Colors -> Color Presets選擇Import選項找到schemes文件夾裏面的主題
image.png

再次打開就有一堆主題了可選擇了
image.png

三、安裝Oh my Zsh

方式1、官網打開,點擊Install oh-my-zsh
image.png
可以看到有兩種安裝方式,但都需要科學上網。

方式2、國內鏡像鏈接下載配置

//1、本地建好目錄準備存儲ohmyzsh的代碼倉庫

//2、下載國內鏡像的安裝包
git clone https://gitcode.com/gh_mirrors/oh/ohmyzsh.git

//3、進入本地倉庫裏面的tools目錄

//4、重點:修改執行鏡像路徑
REMOTE=https://gitcode.com/gh_mirrors/oh/ohmyzsh.git sh install.sh

//5、配置鏡像源
git -C $ZSH remote set-url origin https://gitcode.com/gh_mirrors/oh/ohmyzsh.git

git -C $ZSH pull

image.png

四、安裝Oh-my-Zsh插件

1、zsh-autosuggestions(需下載安裝):高亮顯示所有支持的命令

使用國內鏡像的下載安裝

git clone https://gitcode.com/gh_mirrors/zs/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

image.png

2、zsh-syntax-highlighting(需下載安裝):根據輸入的歷史命令進行智能提示

使用國內鏡像的下載安裝

git clone https://gitcode.com/gh_mirrors/zs/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

image.png

3、修改加入插件配置

//打開文件
vim ~/.zshrc

//在文件中加入插件
plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)
//第一個z插件是自帶的,用於快速跳轉文件 可帶上

//wq退出文件編輯

//執行配置
source ~/.zshrc

image.png

image.png

plugins帶上了z插件命令生效
image.png

資料:
1安裝:macOS必裝神器 - iTerm2 與 Oh My Zsh
2安裝:Mac中安裝OhMyZsh
3安裝:mac 安裝配置oh-my-zsh

4國內倉庫:ohmyzsh
5國內倉庫:插件zsh-syntax-highlighting
6國內倉庫:插件zsh-autosuggestions

user avatar huishou 頭像 ziyeliufeng 頭像 flymon 頭像 201926 頭像
4 位用戶收藏了這個故事!

發佈 評論

Some HTML is okay.