[toc]
Mac 装置配置iterm2
默认mac的终端堪称是真不好用。这里咱们装置iterm2来做为咱们罕用的命令行工具。
1、装置iterm2
- 首先咱们须要装置好brew,没有装置配置brew的请参考笔者之前写过的mac下装置iterm的相干内容。
-
brew install iterm2
2、润饰终端
咱们在启动台里找到装置后的iterm,点击关上
# 配置默认进入展现的用户阐明 vi ~/.bash_profile export PS1="->" exit 再次关上就好了
2.1 查问以后mac 默认的终端shell ,设定为zsh,并批改主题
2.1.1 查问以后shell格局
echo $SHELL
2.1.2 切换终端默认shell为zsh
chsh -s /bin/zsh
2.1.3 装置oh my zsh(两种形式curl和wget )
装置实现后文件在以后用户目录下 (~/.oh-my-zsh)
形式一: 应用git 这里下载到~/.oh-my-zsh下
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
形式二: 应用curl
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
形式三: 应用wget
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
2.1.4 创立一个新的zsh配置文件
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
2.1.5 更换zsh的主题为Dracula:
2.1.5.1下载主题文件
git clone https://github.com/dracula/zs…
2.1.5.2 进入下载后的zsh目录
2.1.5.3 copy 到theme&lib到~/.oh-my-zsh/themes
cp dracula.zsh-theme ~/.oh-my-zsh/themes/dracula.zsh-theme
cp lib ~/.oh-my-zsh/themes
2.1.5.4 批改zsh主题
vim ~/.zshrc
# 批改ZSH_THEME为dracula
ZSH_THEME="dracula"
2.2 批改iterm2 工具主题为dracula
下载dracula colors主题文件
git clone https://github.com/dracula/iterm.git
preferences–>profiles–>colors–>color presets–>import
2.3 命令高亮插件zsh-syntax-highlighting(命令正确绿色,命令谬误红色)
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/zsh-syntax-highlighting
# 编辑配置文件,应用插件
vi ~/.zshrc
# 增加以下内容:
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# 增加令bash_profile配置失效
source ~/.bash_profile
2.4 应用命令提醒插件zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
#编辑配置文件,应用插件
vi ~/.zshrc
# 增加以下内容:
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
发表回复