日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

mac下iterm配色、半透明与样式设置

發布時間:2023/12/13 编程问答 56 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mac下iterm配色、半透明与样式设置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

主要為了實現命令行顏色高亮與整個命令窗口半透明效果。

1、配色主題包下載

  • 1、http://iterm2colorschemes.com/
    下載后解壓,到iterm2中,左上角iTerm2->preferences->Profiles,右側面板找到Colors選項,右下角展開Color Presets…,拉到最下面,選擇import,把下載解壓好的配色主題包下的schemes下的所有.itermcolors文件導入,導入完成后再展開Colors下拉列表,即可選擇不同的配色模板。

  • 2、只下載solarized配色模板
    item2里好像自帶這個配色模板,導入后叫Solarized Dark和Solarized Light。
    http://ethanschoonover.com/solarized
    找到download,下載后解壓,按上面同樣方式導入iterm2-colors-solarized文件夾下的.itermcolors文件。

一般用Solarized Dark即可。

2、修改配置文件

sudo vim /etc/profile

這時候如果有權限問題,sudo chmod 644 /etc/profile
在文件中追加:

find_git_branch () {local dir=. headuntil [ "$dir" -ef / ]; doif [ -f "$dir/.git/HEAD" ]; thenhead=$(< "$dir/.git/HEAD")if [[ $head = ref:\ refs/heads/* ]]; thengit_branch=" (${head#*/*/})"elif [[ $head != '' ]]; thengit_branch=" → (detached)"elsegit_branch=" → (unknow)"fireturnfidir="../$dir"donegit_branch=''}PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND"black=$'\[\e[1;30m\]'red=$'\[\e[1;31m\]'green=$'\[\e[1;32m\]'yellow=$'\[\e[1;33m\]'blue=$'\[\e[1;34m\]'magenta=$'\[\e[1;35m\]'cyan=$'\[\e[1;36m\]'white=$'\[\e[1;37m\]'normal=$'\[\e[m\]'PS1="$white[$white@$green\h$white:$cyan\W$yellow\$git_branch$white]\$ $normal"

配置立刻生效:

source /etc/profile

這時候顏色應該已經顯示了。

3、透明度

透明度,iterm2中,左上角iTerm2->preferences->Profiles,右側找到window選項卡,拖動Transparency調整.

4、安裝oh-my-zsh

  • 安裝oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

修改zsh配置文件

vi ~/.zshrc

ZSH_THEME=”robbyrussell”修改為ZSH_THEME=”agnoster”
重啟items

  • 安裝字體
# clone 先克隆 git clone https://github.com/powerline/fonts.git # install 后安裝 cd fonts ./install.sh

iterm2中,左上角iTerm2->preferences->Profiles,右側text選項卡Font和Non-ASCII Font都設置為
Meslo LG S DZ Regular for Powerline字體。
重啟items

5、語法高亮插件

$ cd到.zshrc所在目錄 $ git clone git://github.com/zsh-users/zsh-syntax-highlighting.git $ 打開 ~/.zshrc # 添加下面的語句到.zshrc文件末尾source XXX/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # 注意:xxx代表zsh-syntax-highlighting所在目錄 # 再次打開.zshrc文件,在最后面添加下面內容plugins=(zsh-syntax-highlighting) # 啟用命令糾錯功能ENABLE_CORRECTION="true"

6、其他設置

設置菜單欄出現位置與主題:iTerm2->preferences->Profiles->Appearance

設置iterm出現位置:iTerm2->preferences->Profiles->window

設置顯現和隱藏熱鍵(option+空格):iTerm2->preferences->Profiles->window

設置之后,通過option+空格就能切換iterm2的顯示與隱藏。


最終效果:

總結

以上是生活随笔為你收集整理的mac下iterm配色、半透明与样式设置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。