【mac开发环境配置】配置 iterm2
【代码】【mac开发环境配置】配置 iterm2。
·
软件安装网站
软件安装网站
参考
mac 安装问题
# 允许任何来源
sudo spctl --master-disable
# 解决:xxx.app已损坏,无法打开,您应该将它移到废纸篓
# 1. 把应用拖到终端,可以获取到应用名称
# 2. 终端中输入命令 sudo xattr -d com.apple.quarantine /Applications/xxx.app解决,
# 如 sudo xattr -d com.apple.quarantine /Applications/Sublime\ Text.app 若中间由空格,用 \ 进行转义
其中xxx.app是出问题的APP名称,有时候app的名字难以输入正确,
这个时候只要在应用列表中将该应用拖到终端中,会自动显示该app的名字
sfltool resetbtm
# 0. 安装 homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
# 下面需要 vpn,如这样使用自己的 vpni
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
# 1. 安装 zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 2. 修改默认 shell
cat /etc/shells
# 改为 zsh
chsh -s /bin/zsh
# 不想用 zsh 后,可以改回 chsh -s /bin/bash
# 3. 修改主题
# 安装 ohmyzsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 下载主题
# 安装 powerlevel9k ,通过 git clone 下载到 oh-my-zsh 放置第三方主题的目录中,用于支持第三方主题
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
# 10k 主题自定义更多
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
# 可以查看默认支持哪些主题 https://github.com/ohmyzsh/ohmyzsh/wiki/themes
# cd ~/.oh-my-zsh/themes && ls
# 修改主题
vim ~/.zshrc
# 把 ZSH_THEME 改为喜欢的主题
# 建议采用这个 10k
ZSH_THEME="powerlevel10k/powerlevel10k"
# 或采用 9k
ZSH_THEME="powerlevel9k/powerlevel9k"
source ~/.zshrc
# 调整背景颜色
Setting --> Profiles --> Colors --> 右下角 Color Presets --> Dark Backgroud
# 取消框选
Setting --> General --> Selection --> 取消勾选 Clicking on a command
# 4. 安装 powerline 和 PowerFonts(powerlevel10k 不需要配置此步骤)
# 安装 pip
brew install python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
# 安装字体
# pip install powerline-status
# git clone
# git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd .. && rm -rf fonts
# 更改字体配置
iTerm2 -> Preferences -> Profiles -> Text,在 Font 区域选中 Change Font,看个人喜欢,选择字体,字体名字带有 Powerline 的就不会乱码了
# 5. 安装插件
# zsh-autosuggestion 是一个 zsh 命令补全,提示的插件
cd ~/.oh-my-zsh/custom/plugins/ && git clone https://github.com/zsh-users/zsh-autosuggestions
vi ~/.zshrc
# 然后找到 plugins 把 zsh-autosuggestions 加上就行
plugins=(zsh-autosuggestions git)
source ~/.zshrc
更多推荐


所有评论(0)