Solarized For Mac Terminal



The color is a dark blue while the standard background for solarized dark is dark and geenish: The standard background color #002b36 is defined here. I tried to change it but there seem to be an interpolation layer inside Emacs that changes it to blue unless I change it to something more different like black. May 23, 2019 solarized is a colour scheme with low contrast, and reduced brightness that enhances readability and reduces eye strain. Homebrew, a package manager for macOS. Zsh, an alternative shell used instead of bash.

by rajaraodv

In this blog I’ll go over the steps to add Themes, Powerline, fonts, and powerline-gitstatus to make your regular Bash Terminal look beautiful and useful as shown in the picture above.

  • 2.Doulbe click the Solarized Dark ansi.terminal file and my terminal looks good. 3.replace my default BSD ls with GNU ls(by installing coreutils) 4.move the solarized.vim to /vim/colors.
  • Today, I finally got sufficiently irritated about the color Vim uses to display comments in Ruby (on a Mac OS X system), so much so that I decided to look for an alternate colorscheme. Somewhere along the way, I stumbled upon Solarized, which looks really nice. Anyway, here is how Vim was displaying Ruby code prior to me using Solarized. Look at the comments in particular it’s very.
  • Aug 29, 2020 iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra - iterm2-oh-my-fish.md. And here's an addition if anybody's using VScode and want to.

It turns out, if you are using Mac, you’ll need to jump through a lot of hoops to get this working as many instructions are for linux, or are out of date. So I thought I'd blog about it - hopefully it'll help you.

Notes:
1. Follow the steps carefully as any mistake will cause a lot of headaches.
2. This is for MacOS and for regular bash in the Terminal.app. I’m not using ZSH or Hyper in this blog — I plan to write different blogs for them.
3. My Versions: Mac High Sierra; git version 2.14.3 (Apple Git-98); Python 2.7.10

OK, by default, when you have a new mac, your Terminal.app will look something like below. Let’s go ahead and add Themes, fonts, and so on.

Step 1 — Add A New Theme

The first obvious step is to enhance the Theme. Terminal doesn’t provide all the cool and fancy themes that you see other developers use. Let’s download a Theme and add it to the Terminal.

In this blog, I’ll add Solarized-Dark theme to our Terminal.

Note: You can download various Themes (.terminal files) from this git repo. Simply open the *.terminal file to install it, i.e. right-click on the *.terminal file > “open with' > Terminal
  1. Go to http://ethanschoonover.com/solarized
  2. Scroll down and download the Theme (solarized.zip)
  3. Extract the solarized.zip file
  4. Open the osx-terminal.app-colors-solarized folder. This folder contains Theme for the terminal.
  5. Double click “Solarized Dark ansi.terminal”fileThis is the specific Theme file for Terminal.app. Note: If you get a warning that this is from an unidentified developer, Right-click on the file and select “Open with” > Terminal option.
  6. At this point, you have the Theme installed into your Terminal. We just need to make it a default Theme.
  7. Open Terminal > Preferences > Text and select the “Solarized Dark …” theme and click on “Default”.

From now on, your Terminal should like below.

Step 2 — Install Powerline

Powerline is a Python app and is a status line plugin for vim, and provides status lines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.

It makes the Terminal prompt look like below.

2.1 Install Python

Because Powerline is a Python app, we need to have Python and that too a proper version of Python.

  • MacOS comes with Python installed already. Ensure Python’s version is 2.7.x by typing python -V in the Terminal.
  • If it’s not 2.7, install Homebrew that allows us to install various software from the CLI, by running:/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
  • Run brew install python to install the latest Python via Homebrew

2.2 Install pip — A package manager for Python (similar to npm)

Install pip by running the following command

$ sudo easy_install pip

2.3 Install XCode Developer CLI tools

XCode Developer CLI tools are used by Powerline and other apps that manipulate core OSX features. So make sure to install the XCode CLI tools by running the following command.

$ xcode-select —-install

Note: The above command opens up Mac’s installer and installs the XCode Developer CLI tools. If it doesn’t work, try xcode-select -r to reset.

2.4 Install Powerline

Finally, install the Powerline (stable version) via pip by running the following command.

If you want to install the latest development branch, then use:

2.5 Add the Powerline daemon to bash

We now need to add the Powerline daemon to bash so that it can monitor the Terminal prompt and make changes.

2.5.1 Copy the Powerline’s installation location

You can figure out the location of Powerline by running the following: pip show powerline-status Copy the value from the Location field.

2.5.2 Add the daemon with a proper location to .bash_profile

  1. Make sure you have .bash_profile file in your root directory. If not following create one by doing: cd ~ && touch ~/.bash_profile

2. Open .bash_profile and add the following:

Note: The location /Users/rupa/Library/Python/2.7/lib/python/site-packages/ is from the previous step (2.5.1). Change it to match your computer’s location.

2.5.3. Restart the Terminal

Completely quit the Terminal if it’s open (Terminal > Quit Terminal). And open it again.

You should be able to simply use $ source ~/.bash_profile to update the settings. But I got some odd powerline-config file is missing! Typically you get this error if you don’t have $HOME/Library/Python/2.7/bin in your PATH.

2.5.4 Your new Terminal

Your new Terminal should look like below. It should be using “Solarized Dark ansi” theme and should show Powerline in the command prompt. But also notice that there are “?” characters! This is because Powerline uses various icons and fonts that are not available by default. So we need to install the fonts.

Step 3 — Install Powerline fonts

To install Powerline fonts, simply go to https://github.com/powerline/fonts. There you’ll see a whole bunch of folders. Each one is a font, aka “Patched fonts”.

It is called “Patched fonts” because people have taken regular fonts and have added/patched additional Powerline specific icons and fonts to them.

3.1 Download the whole repo and unzip it

  • Click on the “Clone or download” button and download the whole repo so you try various fonts.
  • Unzip the fonts-master.zip

3.2 Install some fonts

Let’s open Meslo dotted fontsfolder. It will look like below. You’ll see a whole bunch of .ttf file. Each one of them is a font but some are “bold” version of the font, some are “regular” version and so on.

Simply double-click on the .ttf file and press “Install font” to install the font on your computer.

For our case, let’s install “Meslo LG L DZ Regular for Powerline.ttf” and “Meslo LG L DZ Italic for Powerline.ttf”. This will add a regular and an Italic version of the Meslo font.

3.3 Select the font in the Terminal’s Theme

Remember we added “Solarized Dark” theme in Step 1? That didn’t have any fonts in it and MacOS had some default font. All we need to do is to set our Meslo dotted font for this theme and we are done!

Solarized
  1. Open Terminal > Preferences > Text
  2. Select Solarized Dark ansi Theme
  3. Click on the “Font” button — This opens up “Fonts” dialog
  4. In the “Fonts” dialog, select “Meslo LG L DZ for Powerline” in the Family and also select font size 14 (so it’s easier to read).

3.4 Restart Terminal

Completely quit the Terminal (Terminal > Quit Terminal) and then reopen it.

Step 4 — Adding Git information to the prompt

In order to display various Git status at the prompt, we need to install powerline-gitstatus. It is a simple add-on to Powerline and adds multiple colors and Themes to display various git status information.

4.1 Install powerline-gitstatus

Note: “ — user” command is required to install it in the user’s profile.

4.2 Add powerline-gitstatus color schemes to Powerline

4.2.1 Open the following colorschemes/shell/default.json folder

4.2.2 Add the following colors:

As mentioned in the powerline-gitstatus readme. PS: Just copy the colors inside “groups” and then append it to the default.json as shown below.

Here is my color schemes default.json (you may copy and paste this instead):

4.3 Activate The Theme

4.3.1 Open Theme’s default.json file

4.3.2 Add the following to the default.json

Below is my Powerline’s Theme default.json(you may copy and paste this instead):

Note: I have removed everything from the “right” section and also removed “job number” (“jobnum”) to keep things clean. Otherwise, you’ll see a little artifact on the right-hand side edge of the prompt.

4.4 Restart the Daemon

Save the file and run the following: powerline-daemon —-replace in the Terminal.

Important Note: Every time you make changes to Powerline’s config, in addition to restarting the Terminal, you’ll also need to restartthe daemon to see the changes reflected by running: powerline-daemon —-replace.

4.5 Restart The Terminal

Quit the Terminal (Terminal > Quit Terminal) and open it again.

At this point, we are all done! whew! If you open the Terminal, and navigate to any git repo, and play around, it should look like the following.

Here is how it looks in Solarized-Light Theme:

Here is how it looks in Cobalt2 Theme:

?? Thank you!

If you have questions, please feel free to ask me on Twitter: https://twitter.com/rajaraodv

If this was useful, please click the clap ? button down below a few times to show your support! ⬇⬇⬇ ??

My Other Posts

ECMAScript 2015+

Terminal Improvements

WWW

Virtual DOM

React Performance

Functional Programming

WebPack

  1. Webpack & Hot Module Replacement [HMR] (under-the-hood)

Draft.js

React And Redux :

  1. A Guide For Building A React Redux CRUD App (3-page app)

If this was useful, please share it! Thank you! ??

Precision colors for machines and people

Solarized is a sixteen color palette (eight monotones, eight accent colors)designed for use with terminal and gui applications. It has several uniqueproperties. I designed this colorscheme with both preciseCIELAB lightness relationshipsand a refined set of hues based on fixed color wheel relationships. It has beentested extensively in real world use on color calibrated displays (as well asuncalibrated/intentionally miscalibrated displays) and in a variety of lightingconditions.

See the changelog for what’s new in the most recent release.


Currently available in formats for (cf screenshots below):

Editors & IDEs

  • Vim by me.See also the Vim README.
  • Emacs courtesy of Greg Pfeil(@sellout)in the main repo and in a standalone repository
  • IntelliJ IDEAcourtesy of Johan Kaving and(@flangy)in the main repo and in a standalone repository
  • NetBeans courtesy of Brian Fenton andin the main repo and in a standalone repository
  • SeeStyle theme for Coda & SubEthaEdit courtesy ofJustin Hileman(@bobthecow),in the main repo and in astandalone repository
  • TextMateNOTE: Dark Theme is work in progress
    courtesy of Tom Martin(@deplorableword)in the main repo and in a standalone repository(with key work from Mark Storyand Brian Mathiyakom)
  • TextWrangler & BBEdit courtesy of Rui Carmo(@taoofmac)in the main repo and in a standalone repository
  • Visual Studio courtesy of David Thibault(@leddt)in the main repo and in a standalone repository

  • Xcode work in progress ports are available for Xcode 3 and Xcode 4and will be pulled into the main Solarized project soon.

Terminal Emulators

  • Xresources / Xdefaults
  • iTerm2
  • OS X Terminal.app
  • Putty courtesy Brant Bobbyand on GitHub

Other Applications

  • Mutt e-mail client also by me

Palettes

  • Adobe Photoshop Palette (inc. L*a*b values)
  • Apple Color Picker Palettes
  • GIMP Palette

Don’t see the application you want to use it in? Download the palettes (or pullthe values from the table below) and create your own. Submit it back and I’llhappily note the contribution and include it on this page. See also theUsage & Development section below for details on thespecific values to be used in different contexts.

Download

Click here to download latest version

Solarized For Mac Terminal Linux

Current release is v1.0.0beta2. See the changelog for details on what’snew in this release.

Fresh Code on GitHub

You can also use the following links to access application specific downloadsand git repositories:

  • Canonical Project Page:

    Downloads, screenshots and more information are always available from theproject page: http://ethanschoonover.com/solarized

  • Full Git Repository:

    The full git repository is at: https://github.com/altercation/solarizedGet it using the following command:

  • Application Specific Repositories:

    You can clone repositories specific to many of the application specificcolor themes. See links in the list above or select from this list:

Note that through the magic of git-subtreethese repositories are all kept in sync, so you can pull any of them and get the most up-to-date version.

Features

  1. Selective contrast

    On a sunny summer day I love to read a book outside. Not right in the sun;that’s too bright. I’ll hunt for a shady spot under a tree. The shadedpaper contrasts with the crisp text nicely. If you were to actually measurethe contrast between the two, you’d find it is much lower than black texton a white background (or white on black) on your display device of choice.Black text on white from a computer display is akin to reading a book indirect sunlight and tires the eye.

    Solarized reduces brightness contrast but, unlike many low contrastcolorschemes, retains contrasting hues (based on colorwheel relations)for syntax highlighting readability.

  2. Both sides of the force

    I often switch between dark and light modes when editing text and code.Solarized retains the same selective contrast relationships and overallfeel when switching between the light and dark background modes. A lot ofthought, planning and testing has gone into making both modes feel likepart of a unified colorscheme.

  3. 165 palette modes

    Solarized works as a sixteen color palette for compatibility with commonterminal based applications / emulators. In addition, it has been carefullydesigned to scale down to a variety of five color palettes (four basemonotones plus one accent color) for use in design work such as web design.In every case it retains a strong personality but doesn’t overwhelm.

  4. Precision, symmetry

    The monotones have symmetric CIELAB lightness differences, so switchingfrom dark to light mode retains the same perceived contrast in brightnessbetween each value. Each mode is equally readable. The accent colors arebased off specific colorwheel relations and subsequently translated toCIELAB to ensure perceptual uniformity in terms of lightness. The huesthemselves, as with the monotone *a*b values, have been adjusted withina small range to achieve the most pleasing combination of colors.

    See also the Usage & Development section below fordetails on the specific values to be used in different contexts.

    This makes colorscheme inversion trivial. Here, for instance, is a sass(scss) snippet that inverts solarized based on the class of the html tag(e.g. <html> to give a dark background with red accent):

    See also the full css stylesheet for this site.

Installation

Installation instructions for each version of the colorscheme are included inthe subdirectory README files. Note that for Vim (and possibly for Mutt) youmay want to clone the specific repository (for instance if you are usingPathogen). See the links at the top of this file.

Font Samples

Solarized has been designed to handle fonts of various weights and retainreadability, from the classic Terminus to the beefy Menlo.

Clockwise from upper left: Menlo, Letter Gothic, Terminus, Andale Mono.

Preview all code samples in specific font faces by selecting a link from thislist:

Screenshots

Click to view.

Mutt

C (Vim)

Haskell (Vim)

HTML (Vim)

Java (Vim)

Javascript (Vim)

Pandoc Markdown (Vim)

These screen shots show Vim running with my own Pandoc Kit Syntax.

Perl (Vim)

PHP (Vim)

Python (Vim)

Where Is Mac Terminal

Ruby (Vim)

Shell (Vim)

TeX (Vim)

The Values

L*a*b values are canonical (White D65, Reference D50), other values arematched in sRGB space.

Usage & Development

If you are considering developing a port for Solarized, please see also thedeveloper notes forinformation about optional repository structure and readme formats.

Solarized flips between light and dark modes. In each mode, four monotones formthe core values (with an optional fifth for emphasized content).

Thus in the case of a dark background colorscheme, the normal relationship forbackground and body text is base03:base0 (please note that body text isnotbase00). Note also that in cases where the background and foregroundcan be specified as a pair value, text can be highlighted using a combinationof base02:base1. The L*a*b lightness difference between base03:base0 andbase02:base1 is identical by design, resulting in identical readabilityagainst both normal and highlighted backgrounds. An example use case is foldedtext in Vim which uses base02 for the background and base1 for theforeground.

The values in this example are simply inverted in the case of a lightbackground.