iterm2 终端问题整理

呼出快捷键

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配色

  1. 将下载的solarized配色文件(solarized/vim-colors-solarized/colors/solarized.vim)拷贝到~/.vim/colors目录(没有这个目录就新建)下
  2. 修改~/.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主题

  1. 安装oh-my-zsh成功后(这是前提)
  2. 用 vim 编辑隐藏文件 .zshrc, 终端输入vi ~/.zshrc ZSH_THEME="agnoster"将zsh主题修改为“agnoster”

zsh自动提示与命令补全

比iTerm2自带的更强大的命令提示与补全

  1. 克隆仓库到本地 ~/.oh-my-zsh/custom/plugins 路径下
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
  1. 用 vim 编辑 .zshrc 文件,找到插件设置命令,默认是 plugins=(git) ,我们把它修改为plugins=(zsh-autosuggestions git)
  2. 当你重新打开终端时可能看不到变化,可能你的字体颜色太淡了,我们把其改亮一些,用 vim 编辑 zsh-autosuggestions.zsh 文件,修改ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

zsh语法高亮

  1. 使用homebrew包管理工具安装 zsh-syntax-highlighting 插件
brew install zsh-syntax-highlighting
  1. 配置.zshrc文件,最后一行添加
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  1. 加载.zshrc配置
source ~/.zshrc

重新打开iTerm2窗口(或新打开一个iTerm2窗口)即可以看到效果

git clone 慢问题解决

全局代理

  1. 首先第一步前提是已经打开了SS代理。
  2. 如果要设置全局代理,可以依照这样设置(端口根据具体代理工具来配)
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
  1. 取消方法
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

转载于:https://my.oschina.net/qingjing/blog/1934034

iTerm2是Mac OS上一款相对比较好用的终端工具,它具有一些特性,如主题选择、声明高亮、自动填充建议、隐藏用户名和主机名、分屏效果等。此外,iTerm2可以与Unix shell集成,通过安装相应的shell集成工具,在iTerm2中可以看到命令历史、当前工作目录、主机名、上传下载文件等信息。 对于长期与终端打交道的工程师来说,拥有一款称手的终端管理器是很有必要的。在Windows上,Xshell是最好的选择。而对于MacOS用户来说,iTerm2是非常受欢迎的终端工具。如果你对iTerm2感到不满意,那可能是由于个人的偏好或其他问题,并非iTerm2本身的问题。 总而言之,iTerm2是一款功能强大且灵活的终端工具,它在Mac OS的终端操作上提供了更多的便利和个性化选项。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Mac下iTerm2的安装与配置](https://blog.csdn.net/wangzhongshun/article/details/122089389)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Mac iTerm2 配置教程详细介绍](https://blog.csdn.net/Wjhsmart/article/details/114269257)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值