MAC终端神器iTerm2设置 |
您所在的位置:网站首页 › SkyrimLauncher汉化界面设置 › MAC终端神器iTerm2设置 |
最终效果图
官网下载地址 Mac系统默认使用dash作为终端,可以使用命令修改默认使用zsh:chsh -s /bin/zsh 如果想修改回默认dash,同样使用chsh命令即可:chsh -s /bin/bash 2. 安装Oh my zsh 官方提供两种安装方式,可以任选一种 # curl 安装方式 sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" # wget 安装方式 sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"当使用以上两种方法都报错时,可尝试以下方法手动安装: # 下载 oh-my-zsh 源码 git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh # 并且把 .zshrc 配置文件拷贝到根目录下 cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc # 让 .zshrc 配置文件生效 source ~/.zshrc 3. 安装PowerLine使用命令 pip install powerline-status --user 安装 如安装过程中提示没有pip则使用sudo easy_install pip 如果命令仍然执行错误,可能是由于本机默认python2,此时我们安装并默认使用python3,操作如下: 安装homebrew。 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"更新brew。 brew update安装python3。 brew install python查看python3是否安装成功。 /usr/local/Cellar/目录下是否有python3开头的文件夹,如有既是安装成功指定python3为默认环境。 # 下面Cellar后面的路径根据自身实际python版本修改 export PATH=${PATH}:/usr/local/Cellar/[email protected]/3.9.6/bin alias python=/usr/local/Cellar/[email protected]/3.9.6/bin/python3 alias pip=/usr/local/Cellar/[email protected]/3.9.6/bin/pip3 4. 安装PowerFonts安装字体库需要首先将项目git clone至本地,然后执行源码中的install.sh。 在你习惯的位置新建一个文件夹,如:/Users/dj/opensource mkdir /Users/dj/opensource cd /Users/dj/opensource git clone https://github.com/powerline/fonts.git --depth=1 cd fonts ./install.sh安装好字体库之后,设置iTerm2的字体,具体的操作是iTerm2 -> Preferences -> Profiles -> Text,在Font区域选中Change Font,然后找到Meslo LG字体。 在打开的finder窗口中,双击Solarized Dark.itermcolors和Solarized Light.itermcolors即可安装明暗两种配色。 再次进入iTerm2 -> Preferences -> Profiles -> Colors -> Color Presets中根据个人喜好选择这两种配色中的一种即可。 6. 安装主题下载agnoster主题,执行脚本安装: cd /Users/dj/opensource git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git cd oh-my-zsh-agnoster-fcamblor/ ./install拷贝完成后,执行vim ~/.zshrc命令打开zshrc配置文件,将ZSH_THEME后面的字段改为agnoster。
这时我们打开zshrc文件进行编辑。找到plugins,此时plugins中应该已经有了git,我们需要把高亮插件和命令补全插件也加上,高亮插件zsh-syntax-highlighting必须放在最后一个,并且在文件的最后添加 source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh,执行source ~/.zshrc使文件生效。 更换背景图片方式:iTerm2 -> Preferences -> Profiles -> Window -> BackGround Image勾选图片即可。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |