iterm2

作者: yanmingfei | 来源:发表于2020-12-04 09:46 被阅读0次

下载

iTerm2下载地址:https://www.iterm2.com/downloads.html

配置 iTerm2 主题

## 找到仓库, 然后clone到本地
git clone https://github.com/ohmyzsh/ohmyzsh.git
## 把仓库复制到 .oh-my-zsh目录
cp -r ohmyzsh ~/.oh-my-zsh
## 复制.zshrc
cp ohmyzsh/templates/zshrc.zsh-template ~/.zshrc
## shell换成zsh
chsh -s /bin/zsh

修改主题

将主题修改为ZSH_THEME="agnoster"。


image.png

配置 Meslo 字体

各种的字体地址
https://www.nerdfonts.com/font-downloads
meslo nerd font字体
https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip

image.png

配置powerlevel9k专属自己的主题

执行安装主题

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

配置 oh-my-zsh :编辑 ~/.zshrc 修改zsh的主题
POWERLEVEL9K_MODE='nerdfont-complete'
ZSH_THEME="powerlevel9k/powerlevel9k"

配置皮肤

链接: https://pan.baidu.com/s/1eDaRNEklpGXegRUi_T9pbA 密码: 87lh

配置webstorm

image.png

高亮和补全

 git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
 git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

配置
code ~/.zshrc文件下的plugins选项改为
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

image.png

更新完 zsh 说我目录权限问题的解决

Last login: Mon May 28 13:35:31 on ttys001
You have mail.
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxrwx 7 hans admin 238 2 9 10:13 /usr/local/share/zsh
drwxrwxrwx 6 hans admin 204 10 1 2017 /usr/local/share/zsh/site-functions

[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod g-w,o-w

[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.

解决方法
终端的执行下面两行就OK了

chmod 755 /usr/local/share/zsh
chmod 755 /usr/local/share/zsh/site-functions

终端名称过长解决办法

prompt_context() {
 if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
   fi
 }

vscode 终端配置zsh

    "terminal.integrated.shell.osx": "zsh",
    "terminal.integrated.fontFamily": "MesloLGM Nerd Font",
    "terminal.integrated.fontSize":14

相关文章

网友评论

      本文标题:iterm2

      本文链接:https://www.haomeiwen.com/subject/qkvmwktx.html