关于java:Mac安装配置iterm2

3次阅读

共计 1626 个字符,预计需要花费 5 分钟才能阅读完成。

[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
欢送大家点赞珍藏!
正文完
 0