在 Mac OS X 终端里使用 Solarized 配色方案

相信长期浸泡在终端和代码的小伙伴们都有一套自己喜爱的配色方案。以前一直在用简单、适合阅读的 Terminal.app 配色方案换到 MacBook Pro with Retina display 后发现这个配色时间看长了眼睛有点累。不断有人推荐 Solarized,看了一些截图,感觉还不错,决定试一下。

Solarized 是目前最完整的 Terminal/Editor/IDE 配色项目,几乎覆盖所有主流操作系统(Mac OS X, Linux, Windows)、编辑器和 IDE(Vim, Emacs, Xcode, TextMate, NetBeans, Visual Studio 等),终端(iTerm2, Terminal.app, Putty 等)。类似的项目还有 Tomorrow Theme.

要在 Mac OS X 终端里舒服的使用命令行(至少)需要给3个工具配色,terminal、vim 和 ls. 首先下载 Solarized:

$ git clone git://github.com/altercation/solarized.git 

Terminal/iTerm2

Mac OS X 自带的 Terminal 和免费的 iTerm2 都是很好用的工具,iTerm2 可以切分成多窗口,更方便一些。

如果你使用的是 Terminal 的话,在 solarized/osx-terminal.app-colors-solarized 下双击 Solarized Dark ansi.terminal 和 Solarized Light ansi.terminal 就会自动导入两种配色方案 Dark 和 Light 到 Terminal.app 里。

如果你使用的是 iTerm2 的话,到 solarized/iterm2-colors-solarized 下双击 Solarized Dark.itermcolors 和 Solarized Light.itermcolors 两个文件就可以把配置文件导入到 iTerm 里。

Vim

Vim 的配色最好和终端的配色保持一致,不然在 Terminal/iTerm2 里使用命令行 Vim 会很别扭:

$ cd solarized $ cd vim-colors-solarized/colors $ mkdir -p ~/.vim/colors $ cp solarized.vim ~/.vim/colors/ $ vi ~/.vimrc syntax enable set background=dark colorscheme solarized 

iterm2 and solarized

ls

Mac OS X 是基于 FreeBSD 的,所以一些工具 ls, top 等都是 BSD 那一套,ls 不是 GNU ls,所以即使 Terminal/iTerm2 配置了颜色,但是在 Mac 上敲入 ls 命令也不会显示高亮,可以通过安装 coreutils 来解决(brew install coreutils),不过如果对 ls 颜色不挑剔的话有个简单办法就是在 .bash_profile 里输出 CLICOLOR=1:

$ vi ~/.bash_profile export CLICOLOR=1 

vim and solarized

来源:https://yq.aliyun.com/articles/229574


智能推荐

Mac OS X: 在脚本里关闭Airport

Mac OS X: 在脚本里关闭Airport 最初问题的由来是这样的,我这里为一个公司做他们公司的系统影像文件制定系统恢复策略,其中一个要求是,公司需要在Desktop上把Airport关掉,在笔记本上把Airport打开,而且不要让用户随便打开或者关闭Airport。这个在公司环境是有理由这样要求的,首先,同时使用有线和无线网,多占用DHCP分配的IP资源;而且对于目前本来就紧缺的无线连接来说...

在 Mac OS X 上安装 Docker(转)

http://www.oschina.net/translate/installing-docker-on-mac-os-x?print 在 Mac OS X 上安装 Docker 注意:Docker支持Mac OS X 10.6 "Snow Leopard" 及其以上版本. Docker引擎使用了Linux内核特定的特性,所以要让它运行在OS X上我们需要用一个轻量型的虚拟机...

Qt在Mac OS X下的编程环境搭建

在Mac OS X下使用Qt开发,需要配置Qt库和编译器。编译器只能使用苹果公司自主研发的Clang。 1、分别下载并安装XCode和Command Line Tools(必须安装),安装完毕后,Clang就有了。 https://developer.apple.com/downloads/ 2、下载Qt并默认安装 http://download.qt.io/official_releases/q...

在Mac OS X中下载并安装StarUML

StarUML是我们常用的UML建模工具之一,下面来说明一下如何在OS X系统中下载安装并正常运行StarUML。 1. 下载地址 访问StarUML官网进行下载:http://staruml.io 进入官网后点击右上角的DOWNLOAD,如图所示: 2. 下载 点击DOWNLOAD后,进入下载页面: 点击最左边的MAC OS X系统下的Download按键,开始下载 3. 安装 下载完成后在访达...

Qt在Mac OS X下的编程环境搭建

原文地址::https://blog.csdn.net/u014252478/article/details/80755876 相关文章 1、MacOS 开发 — MacOS安装Qt Create----https://blog.csdn.net/heroguo_jp/article/details/88562154 2、Mac OS X 下Qt 安装完整手册----https://b...

猜你喜欢

在VMware Workstation 12中安装Mac OS X 10.11

不多说,直接写安装的过程。 所需软件和工具 ======================================================= 1.首先我们下载一个VMware Workstation 12 https://www.vmware.com/cn.html 具体安装过程就不说了。 2.下载一个Mac OS X 10.11 这个百度有很多,这里给出我下载的那个 链接如下 ht...

hadoop2.x 伪集群搭建

作者:穿越   -- 教程来源于网络,回归于网络 前置准备 1 分析 Hadoop 2.0 里的 HA实现方式。作为了解, 如下图:  图片来源于网络 HA(High Available):高可用性集群,是保证业务连续性的有效解决方案,一般有两个或两个以上的节点,且分为活动节点及备用节点。 ZK(Zookeeper):用作NN的高活框架 ZKFC(ZooKeeper ...

Net设计模式之抽象工厂模式(Abstract Factory Pattern)(2)

四.案例分析(Example) 1、场景 使用抽象工厂+反射+配置文件实现数据访问层程序。结构如下图所示   用反射+抽象工厂+配置文件的数据访问程序。 Assembly.Load("程序集名称").CreateInstance("命名空间.类名称")。比如: IProduct product=(IProduct)Assembly.Load(&qu...

玩转Zynq连载13——使用GIT进行工程备份和版本管理5

特权同学玩转Zynq连载13——使用GIT进行工程备份和版本管理5 2.5查看旧版本的文件 Show Log命令查看本地版本信息,选中需要查看的旧版本,如这里选中ver1,右键单击并选中命令Reset “master” to this …。 弹出如下Reset界面,勾选Commit和Hard:Reset working tree and...

强行复习第三天:c语言(下)

说好的段位难道不刷了嘛。。。。 复习归复习,题还是要刷啊喂! 明天就开始上课了。。。时间越来越紧了。。。   公众号里好多该更新的都没更。。。欠了一个app推荐,欠了一个流浪地球影评,欠了个黑寡妇个人向分析,还有一个预支出去了的复联四。。。 哦,对了,还想写一个乐园系列来着,仙女乐园写完了,还有妖精乐园想写。。。外加还想推荐点男歌手来着了。。。 林俊杰也没写。。 那个很棒的对比向idea...

问答精选

Is this a good way to stream data through django channels?

I have a database where new data is being inserted every second. When the websockets connection is first established, I want to send all the data using django channels. Then, I want the new data data ...

JUnit theories sets params to null

I have a test class that using theories like this: I don't understand why I am getting x as null. I tried the same with parameterized tests and still null. What am I missing here? The problem within y...

How to disable Android home and back button from Delphi

I'm writing an app for an Android tablet in Delphi XE7. I want to turn off home and back button so no one can leave the application. I have found many answers, but none refers to Delphi. How can I ach...

Typescript generic function accept object that has first argument as a key

I want to make a function that accepts a string first argument, and then will only accept a second object argument if it has the first argument as a key, with a boolean value: This works but is undesi...

About headers, forwards and how to organize a lot of includes

I have 3 classes (it could be 300) , each one with its own header and implementation. I'd like to write an 'elegant' way to organize the way I load of any class needed by every class of the three. May...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答