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










* {display: table-row!important}
.MJXp-surd {vertical-align: top}
.MJXp-surd > * {display: block!important}

.MJXp-mphantom {visibility: hidden}
.MJXp-munderover {display: inline-table!important}
.MJXp-over {display: inline-block!important; text-align: center}
.MJXp-over > * {display: block!important}
.MJXp-munderover > * {display: table-row!important}
.MJXp-mtable {vertical-align: .25em; margin: 0 .125em}
.MJXp-mtable > * {display: inline-table!important; vertical-align: middle}
.MJXp-mtr {display: table-row!important}
.MJXp-mtd {display: table-cell!important; text-align: center; padding: .5em 0 0 .5em}
.MJXp-mtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-mlabeledtr {display: table-row!important}
.MJXp-mlabeledtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mlabeledtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 1px 3px; font-style: normal; font-size: 90%}
.MJXp-scale0 {-webkit-transform: scaleX(.0); -moz-transform: scaleX(.0); -ms-transform: scaleX(.0); -o-transform: scaleX(.0); transform: scaleX(.0)}
.MJXp-scale1 {-webkit-transform: scaleX(.1); -moz-transform: scaleX(.1); -ms-transform: scaleX(.1); -o-transform: scaleX(.1); transform: scaleX(.1)}
.MJXp-scale2 {-webkit-transform: scaleX(.2); -moz-transform: scaleX(.2); -ms-transform: scaleX(.2); -o-transform: scaleX(.2); transform: scaleX(.2)}
.MJXp-scale3 {-webkit-transform: scaleX(.3); -moz-transform: scaleX(.3); -ms-transform: scaleX(.3); -o-transform: scaleX(.3); transform: scaleX(.3)}
.MJXp-scale4 {-webkit-transform: scaleX(.4); -moz-transform: scaleX(.4); -ms-transform: scaleX(.4); -o-transform: scaleX(.4); transform: scaleX(.4)}
.MJXp-scale5 {-webkit-transform: scaleX(.5); -moz-transform: scaleX(.5); -ms-transform: scaleX(.5); -o-transform: scaleX(.5); transform: scaleX(.5)}
.MJXp-scale6 {-webkit-transform: scaleX(.6); -moz-transform: scaleX(.6); -ms-transform: scaleX(.6); -o-transform: scaleX(.6); transform: scaleX(.6)}
.MJXp-scale7 {-webkit-transform: scaleX(.7); -moz-transform: scaleX(.7); -ms-transform: scaleX(.7); -o-transform: scaleX(.7); transform: scaleX(.7)}
.MJXp-scale8 {-webkit-transform: scaleX(.8); -moz-transform: scaleX(.8); -ms-transform: scaleX(.8); -o-transform: scaleX(.8); transform: scaleX(.8)}
.MJXp-scale9 {-webkit-transform: scaleX(.9); -moz-transform: scaleX(.9); -ms-transform: scaleX(.9); -o-transform: scaleX(.9); transform: scaleX(.9)}
.MathJax_PHTML .noError {vertical-align: ; font-size: 90%; text-align: left; color: black; padding: 1px 3px; border: 1px solid}
-->

 

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

2018年03月05日 12:39:10 thatway_wp 阅读数 17105
 

主要为了实现命令行颜色高亮与整个命令窗口半透明效果。

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
 
  • 1

这时候如果有权限问题,sudo chmod 644 /etc/profile
在文件中追加:

find_git_branch () {

local dir=. head

until [ "$dir" -ef / ]; do

if [ -f "$dir/.git/HEAD" ]; then

head=$(< "$dir/.git/HEAD")

if [[ $head = ref:\ refs/heads/* ]]; then

git_branch=" (${head#*/*/})"

elif [[ $head != '' ]]; then

git_branch=" → (detached)"

else

git_branch=" → (unknow)"

fi

return

fi

dir="../$dir"

done

git_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的显示与隐藏。


最终效果:

iTerm2 配色方案(oh-my-zsh& Powerline)

mac下iterm配色、半透明与样式设置的更多相关文章

  1. Mac 下用 go 开发Android应用环境设置

    需要的工具 设置代理 请参考:http://www.cnblogs.com/ghj1976/p/5087049.html Mac 下命令行设置代理: export http_proxy=http:// ...

  2. 转载-Mac下iterm无法使用rz并提示waiting to receive.**B0100000023be50

    原文链接:https://www.kissfree.cn/2530.html 安装rz sz   1 2 brew install lrzsz   运行rz会报类似错:rz会出现?z waiting ...

  3. mac下 Eclipse代码自动补齐 设置

    Eclipse -> Perferences -> Java -> Editor -> Content Assist如下图. 将auto activation triggers ...

  4. 给Mac下的iTerm2增加配色

    iterm2就不说了,Mac下非常好用的终端,这里就先谈谈如何给其增加配色,效果如下图 可以来这下载theme : http://iterm2colorschemes.com/ 1.先编辑你的prof ...

  5. Mac下设置Android源代码编译环境

    在Mac下编译Android最麻烦的就是设置Android的编译环境了,做完这一步基本上剩下的就是近乎傻瓜式的操作了.说起来也简单就三步,设置大小写敏感的文件系统.安装编译工具.设置文件系统同时能打开 ...

  6. mac 下 apache设置

    windows下面的apache配置 apache是mac下是默认就有的,我们只需使用命令开启.暂停和重启就好了 sudo apachectl start sudo apachectl stop su ...

  7. mac下mysql5.6字符集设置

    http://geeksblog.cc/2016/05/28/mac-mysql-unicode/   mac下mysql5.6字符集设置: 在mac下设置mysql5.6字符集时踩过的坑,百分百保证 ...

  8. Mac下的Chrome或Safari访问跨域设置,MBP上使用模拟器Simulator.app或iphone+Safari调试网页

    Mac下的Chrome或Safari访问跨域设置: mac下终端启动Chrome $ open -a Google\ Chrome --args --disable-web-security 或 /A ...

  9. mac下java的安装和升级以及相关环境设置

    安装:brew cask install java8 如果存在多个java,可以设置JAVA_HOME指定java版本 打开终端,执行/usr/libexec/java_home -V 查看MAC下J ...

随机推荐

  1. Linux学习笔记(十)shell基础:历史命令、命令补全、输出重定向、输出重定向

    一.历史命令 history [选项] [历史命令保存文件] -c 清空历史命令 -w 吧缓存中的历史命令写入历史命令保存文件~/.bash_history中 系统会默认将上次注销登录(正确退出)之前 ...

  2. vba代码阅读

    #If Vba7 Then #如果是运行在64位office上 Declare PtrSafe Sub...#Else #如果是运行在32位office上 Declare Sub...#EndIf 在 ...

  3. 多域名解析到同一网站C的php重定向代码

    在index.php最前面加上以下代码: <?php if(strpos($_SERVER['HTTP_HOST'],'afish.cnblogs.com')===false){ #header ...

  4. 部署WCF Lib到IIS

    打开VS2013,新建项目,选择WCF|WCF服务库,取名WCFWithIIS 2. 我们用演示一个计算加法的服务.简单起见,直接在IService接口中添加加法接口 3. 实现这个加法 4. 生成项 ...

  5. MySQL常见水平分表技术方案

    根据经验,Mysql表数据一般达到百万级别,查询效率会很低,容易造成表锁,甚至堆积很多连接,直接挂掉:水平分表能够很大程度较少这些压力. 1.按时间分表 这种分表方式有一定的局限性,当数据有较强的实效 ...

  6. ansible的两种命令执行方式 : ad-hoc / playbook以及通过setup模块获取系统参数

    一.什么是ad-hoc和playbook  ad-hoc : 如果我们敲入一些命令去快速的完成一些操作,而不需要将这些执行过的命令刻意保存下来,这样的命令就叫做as-hoc命令,这里不做过多赘述. p ...

  7. Codeforces Round #585 (Div. 2) A. Yellow Cards(数学)

    链接: https://codeforces.com/contest/1215/problem/A 题意: The final match of the Berland Football Cup ha ...

  8. jquery 下载

    jquery下载所有版本(实时更新) 摘自:http://www.jq22.com/jquery-info122 插件描述:jquery下载,实时更新jquery1.2到最新3.2.1所有版本下载 j ...

  9. vue使用Echarts图表

    vue使用Echarts图表 童话_xxv 关注  0.5 2018.12.11 09:09* 字数 325 阅读 1456评论 2喜欢 13 在开发后台系统时,使用图表进行数据可视化,这样会使数据更 ...

  10. luogu 2943 [USACO09MAR]清理Cleaning Up 动态规划

    非常巧妙的动态规划. 你会发现每一个区间地颜色种类不能超过 $\sqrt n$, 所以可以直接枚举区间颜色种类. 令这个为 $pos[j],$ 然后考虑如何去更新这个东西就行了. Code: #inc ...