呼出快捷键
iTerm2->preferences->keys->HotKey
呼出位置
iTerm2->preferences->Profiles->window->style
中选择不同的位置
透明度
iTerm2->preferences->Profiles->window
然后拖动Transparency
调整
配色
- 这一步新版本好像原生支持,直接可选,这里做个记录
iterm2 配色
选用 solarized,下载解压,然后打开 iTerm -> Preferences -> Profiles -> colors
选项,点击右下角的 Color Presets
选项,选择import
,导入解压到的 solarized 文件下的Solarized Dark.itermcolors
vim配色
- 将下载的solarized配色文件(solarized/vim-colors-solarized/colors/solarized.vim)拷贝到~/.vim/colors目录(没有这个目录就新建)下
- 修改~/.vimrc文件,添加以下设置
syntax enable
set background=dark
colorscheme solarized
然后Preferences -> Profiles ->Text
中取消Draw bold text in bright color
的勾选
主题
字体
应用“agnoster”主题需要特殊的字体支持,否则会出现乱码情况,按如下方式安装powerline字体,然后在iTerm2中应用字体 iTerm -> Preferences -> Profiles -> Text ->font -> Change Font
中选择使用 Meslo 字体,例如:12pt Meslo LG S DZ Regular for Powerline
powerline
# 1. clone
git clone https://github.com/powerline/fonts.git --depth=1
# 2.install
cd fonts
./install.sh
# 3. clean-up a bit
cd ..
rm -rf fonts
重新打开iTerm2窗口(或新打开一个iTerm2窗口)即可以看到字体效果
zsh主题
- 安装oh-my-zsh成功后(这是前提)
- 用 vim 编辑隐藏文件 .zshrc, 终端输入
vi ~/.zshrc
ZSH_THEME="agnoster"
将zsh主题修改为“agnoster”
zsh自动提示与命令补全
比iTerm2自带的更强大的命令提示与补全
- 克隆仓库到本地 ~/.oh-my-zsh/custom/plugins 路径下
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
- 用 vim 编辑 .zshrc 文件,找到插件设置命令,默认是
plugins=(git)
,我们把它修改为plugins=(zsh-autosuggestions git)
- 当你重新打开终端时可能看不到变化,可能你的字体颜色太淡了,我们把其改亮一些,用 vim 编辑 zsh-autosuggestions.zsh 文件,修改
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
zsh语法高亮
- 使用homebrew包管理工具安装 zsh-syntax-highlighting 插件
brew install zsh-syntax-highlighting
- 配置.zshrc文件,最后一行添加
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
- 加载.zshrc配置
source ~/.zshrc
重新打开iTerm2窗口(或新打开一个iTerm2窗口)即可以看到效果
git clone 慢问题解决
全局代理
- 首先第一步前提是已经打开了SS代理。
- 如果要设置全局代理,可以依照这样设置(端口根据具体代理工具来配)
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
- 取消方法
git config --global --unset http.proxy
git config --global --unset https.proxy
注意,这里只针对https协议有效,对于SSH协议无效。
局部代理
挂全局代理,这样如果需要克隆coding之类的国内仓库,会奇慢无比,建议只对github进行代理,对国内的仓库不影响。
git config --global http.https://github.com.proxy https://127.0.0.1:1080
git config --global https.https://github.com.proxy https://127.0.0.1:1080
socks5代理
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
git config --global https.https://github.com.proxy socks5://127.0.0.1:1080