Instantly share code, notes, and snippets.

Embed
What would you like to do?
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

How to install

iTerm2

brew cask install iterm2

Or, if you do not have homebrew (you should ;)): Download and install iTerm2

iTerm2 has better color fidelity than the built in Terminal, so your themes will look better.

Get the iTerm color settings

Just save it somewhere and open the file(s). The color settings will be imported into iTerm2. Apply them in iTerm through iTerm → preferences → profiles → colors → load presets. You can create a different profile other than Default if you wish to do so.

Oh My Zsh

More info here: https://github.com/robbyrussell/oh-my-zsh

Install with curl

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

When the installation is done, edit ~/.zshrc and set ZSH_THEME="agnoster"

Powerlevel9k

If you prefer the Powerlevel9k look with added info such as exit codes and timestamps on the right, run:

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

Then edit your ~/.zshrc and set ZSH_THEME="powerlevel9k/powerlevel9k".

Powerlevel9k offers a whole lot more, best is to check out these user made configs yourself.

Install a patched font

Open the downloaded font and press "Install Font".

Set this font in iTerm2 (14px is my personal preference) (iTerm → Preferences → Profiles → Text → Change Font).

Restart iTerm2 for all changes to take effect.

Further tweaking

Things like

  • auto suggestions
  • word jumping with arrow keys / natural text editing
  • shorter prompt style
  • syntax highlighting
  • visual studio code config

can be found in the section below.

Auto suggestions (for Oh My Zsh)

Auto suggestions

Just follow these steps: https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md#oh-my-zsh

If the auto suggestions do not appear to show, it could be a problem with your color scheme. Under "iTerm → Preferences → Colors tab", check the value of Black Bright, that is the color your auto suggestions will have. It will be displayed on top of the Background color. If there is not enough contrast between the two, you won't see the suggestions even if they're actually there..

Enable word jumps and word deletion, aka natural text selection

By default, word jumps (option + → or ←) and word deletions (option + backspace) do not work. To enable these, go to "iTerm → Preferences → Profiles → Keys → Load Preset... → Natural Text Editing → Boom! Head explodes"

Custom prompt styles

By default, your prompt will now show “user@hostname” in the prompt. This will make your prompt rather bloated. Optionally set DEFAULT_USER in ~/.zshrc to your regular username (these must match) to hide the “user@hostname” info when you’re logged in as yourself on your local machine. You can get your exact username value by executing whoami in the terminal.

For further customisation of your prompt, you can follow a great guide here: https://code.tutsplus.com/tutorials/how-to-customize-your-command-prompt--net-24083

Syntax highlighting

brew install zsh-syntax-highlighting

If you do not have or do not like homebrew, follow the installation instructions instead.

After installation through homebrew, add

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

to the end of your .zshrc file. After that, it's best to restart your terminal. Sourcing your ~/.zshrc does not seem to work well with this plugin.

Visual Studio Code config

Installing a patched font will mess up the integrated terminal in VS Code unless you use the proper settings. You'll need to go to settings (CMD + ,) and add or edit the following values:

  • for Source Code Pro: "terminal.integrated.fontFamily": "Source Code Pro for Powerline"
  • for Meslo: "terminal.integrated.fontFamily": "Meslo LG M for Powerline"
  • for other fonts you'll need to check the font name in Font Book.

You can also set the fontsize e.g.: "terminal.integrated.fontSize": 14

@naartjie

This comment has been minimized.

naartjie commented Dec 5, 2014

Awesome 👍 thanks. Always wondered how the cool kids got their prompts looking like it was UI, with those arrows and blocks.

@yev

This comment has been minimized.

yev commented Apr 9, 2015

Very nice! Thank you, Kevin!

@SteveClement

This comment has been minimized.

SteveClement commented May 22, 2015

For the shorter prompt style you could use this for remote machines:

[[ -n "$SSH_CLIENT" ]] || export DEFAULT_USER="steve"

@dritter

This comment has been minimized.

dritter commented Jun 2, 2015

Maybe you like a more advanced powerline-style theme like powerlevel9k.

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Jun 7, 2015

Thanks for the comments, glad to help your terminals look better / have a bit more functionality :).
Thx for the tip @SteveClement, I'll need to test it out first, then I'll I add it to the instructions.

@abea

This comment has been minimized.

abea commented Sep 6, 2015

Thank you, sir. the official iTerms Solarized Dark link doesn't seem to be working, so this is clutch.

@ding404

This comment has been minimized.

ding404 commented Sep 6, 2015

great thank you ! sir. I got DejaVu Sans Mono in my iTerm !

@kumarabinash

This comment has been minimized.

kumarabinash commented Sep 25, 2015

@abea It works fine. If you used vim or something similar to disrupt its indentation, it won't work. Happened with me also. Try saving it again with proper indentation(perhaps using sublime text) and no trailing spaces, and load it again.

@sundiontheway

This comment has been minimized.

sundiontheway commented Oct 25, 2015

nice job!

@sec-init

This comment has been minimized.

sec-init commented Oct 30, 2015

Excellent job with the theme colors. Looks great.

@orarnon

This comment has been minimized.

orarnon commented Dec 8, 2015

Hey, I'm a newbie but I couldn't set the prompt right. I'm using: export DEFAULT_USER="my_user_name"
But the prompt remains the same. What am I missing? (Using OSx by the way)

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Dec 8, 2015

Here's how my config looks like exactly (excerpt):

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"

DEFAULT_USER="kevin"

So it's not declaring export or anything. After changing the value make sure to source your .zshrc

source ~/.zshrc

Or just quit and restart your iTerm to make sure your changes are picked up. Let me know if that works for you :).

@nehero

This comment has been minimized.

nehero commented Dec 22, 2015

Really liking this theme.

Is there anyway to change the prompt to just the current working directory instead of the full string?

@jnandez1986

This comment has been minimized.

jnandez1986 commented Jan 6, 2016

@kevin-smets I got it working, I just had to source my .zshrc. Thanks!

@yzq1989

This comment has been minimized.

yzq1989 commented Jan 8, 2016

nice!

@bkate

This comment has been minimized.

bkate commented Jan 13, 2016

thank you !!

@skapil

This comment has been minimized.

skapil commented Jan 20, 2016

Thanks @kevin-smets. I got it working!

@sulmanweb

This comment has been minimized.

sulmanweb commented Jan 23, 2016

Great help

@Ourelius

This comment has been minimized.

Ourelius commented Jan 27, 2016

screenshot_mbpr_ 2016-01-27 um 18 23 32

This is how font size 14/14 looks like in my case! 14/18 and 18/24 isn't working, too!

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Jan 29, 2016

@Ourelius are you using another terminal or something? The colors seem to be rather off as well..

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Jan 29, 2016

@nehero if you just do echo $PROMPT you can see the default construction of the PROMPT variable in Zsh. You can overwrite this in your .zshrc of course, a great tutorial on that can be found @ tuts+

@BelfordZ

This comment has been minimized.

BelfordZ commented Feb 1, 2016

looks great, but instead of mapping option+arrows, why not in profile -> keys just map left option to be Meta?

That way, all the nice stuff still works (option + b === option + <-)

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Feb 3, 2016

@BelfordZ, that did not work for me, no matter what combination. The only consistent solution I found is the one I added to the readme. That and you get a warning when switching to meta. Any improvements are always welcome of course, but I cannot seem to confirm this is actually a better change I'm afraid.

@vuhrmeister

This comment has been minimized.

vuhrmeister commented Feb 3, 2016

@BelfordZ, @kevin-smets, both variants does not work for me :/
Any idea why?

@DONSA

This comment has been minimized.

DONSA commented Feb 25, 2016

It's possible to style the numbers on the left?
A different background would be nice.

screen shot 2016-02-25 at 23 49 40

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Feb 26, 2016

@DONSA it's all built into the iTerm colors setting (preferences -> profiles -> colors). You can easily change any color by hand, or by importing another theme altogether; you can take a pick from these: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/schemes.

E.g. changing the background is done simply by clicking the color next to "Basic colors - Background" and picking another color, but you can easily get a theme that is inconsistent this way.

@vuhrmeister, I have not found any other way to enable this sadly...

@DONSA

This comment has been minimized.

DONSA commented Feb 26, 2016

I mean, a different background only on Vim line numbers.

@chrislovecnm

This comment has been minimized.

chrislovecnm commented Feb 28, 2016

Great write up!!

Also make sure you don't use Apple's version of git ... it DOES not play nice with oh-my-zsh.

@pablo-honeybear

This comment has been minimized.

pablo-honeybear commented Mar 1, 2016

What is your color set for the Linux commands?

@LmKupke

This comment has been minimized.

LmKupke commented Mar 3, 2016

@kevin-smets Love the theme. How do you make the Linux commands a different color?

@niamulrox

This comment has been minimized.

niamulrox commented Mar 18, 2016

Hi,
How to remove the red marked part ?
iterm

@florentroques

This comment has been minimized.

florentroques commented Mar 18, 2016

@niamulrox
You need to set DEFAULT_USER with your username (niamulhasan) in your .zshrc file
To do so, run this command:

echo "DEFAULT_USER=\"niamulhasan\"" >> ~/.zshrc && source ~/.zshrc

You're done :)

@vkrishnasamy

This comment has been minimized.

vkrishnasamy commented Mar 23, 2016

lucid instructions which made it easy. Thanks a ton.

@ericdowell

This comment has been minimized.

ericdowell commented Mar 29, 2016

@niamulrox you also have to override prompt_context (source)

echo "prompt_context () { }" >> ~/.zshrc && source ~/.zshrc

Also if you didn't already override the DEFAULT_USER as mentioned before:

echo "DEFAULT_USER=\"\"" >> ~/.zshrc && source ~/.zshrc
@joakim5937x

This comment has been minimized.

joakim5937x commented Apr 7, 2016

How did you get the syntax highlighting for: cd, touch etc. to work?

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Apr 14, 2016

@joakim5937x sadly I did not, so that's a good remark :). The screenshot is not mine, I should update it to reflect the actual result more closely. Sorry for the false promise :D.

@mikesilence

This comment has been minimized.

mikesilence commented Apr 21, 2016

Hi, how did short path name like this
2016-04-21 16 13 31

@evoactivity

This comment has been minimized.

evoactivity commented May 6, 2016

The word jumps don't seem to work, just outputs [C or [D

@Angekap

This comment has been minimized.

Angekap commented May 19, 2016

@kevin-smets while I'm getting this to work, whenever I exit and re-open iTerm, the changes revert to their original state.
I've changed the DEFAULT_USER, and sourced the ~/.zshrc....but this does not remember my settings :(

@nickam992

This comment has been minimized.

nickam992 commented May 25, 2016

@kevin-smets Did you mean to put quotes around agnoster? It only worked after I removed the quotes.

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented May 29, 2016

@nickam992 indeed, there are double quotes around my entry, without issues. Glad you got it working :).

The word jump settings don't seem to work all too well for everyone, tried out another method and added this to the gist.

Ping @evoactivity & @vuhrmeister

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented May 29, 2016

@joakim5937x I added syntax highlighting :)

@ermand

This comment has been minimized.

ermand commented Jun 9, 2016

Thanks @kevin-smets for these instructions :)

@ORESoftware

This comment has been minimized.

ORESoftware commented Jun 14, 2016

I get this LOL :(

screen shot 2016-06-13 at 7 31 27 pm

@petrillek

This comment has been minimized.

petrillek commented Jun 14, 2016

I've the same problem as @ORESoftware. Yesterday it was fine, today it appears it is ignoring the font setting.

@khadorkin

This comment has been minimized.

khadorkin commented Jun 14, 2016

@petrillek @ORESoftware Looks like you haven't install powerline font in iTerm

@roma86

This comment has been minimized.

roma86 commented Jun 18, 2016

@khadorkin, hello. What do you mean haven't install fonts in iTerm?

I followed instructions in this topic.

brocken

iTerm2 settings

Font Book

All fonts from https://github.com/powerline/fonts installign through install.sh

iTerm restarted multiple times. Mac os restarted twice.

@petertom51

This comment has been minimized.

petertom51 commented Jun 18, 2016

@roma86, I use the font Meslo LG M DZ for Powerline and it works.
image
You may try the Menlo font provide from Powerline shown the second line of the pic below.
image

I encounter a issue of the prompt.
My triangle color is white. Is someone can help me to solve this?
I use iTerm2 v3.0.2
Many thanks.
image

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Jun 20, 2016

@roma86 you need to use a powerline font, otherwise it won't work. The regular Menlo will not suffice.

@petertom51 I use the exact same version, not sure where your problem is coming from. Have you tried using another theme? The only diff I see is that anti-aliasing in your prefs is disabled, that should not matter though but you never know, maybe toggling that could make a difference.

/edit just saw, the other text in your prompt is white as well.. Did you define other colors anywhere but the default?

@YassineE

This comment has been minimized.

YassineE commented Jun 21, 2016

Hi,

First, thanks for this amazing work !!!
Secondly, there is a way to have specific color for the directories ?

Cheers,

@maurocarrero

This comment has been minimized.

maurocarrero commented Jun 25, 2016

Very nice, thanks.

@terle

This comment has been minimized.

terle commented Jun 30, 2016

God this is so nice. Thanks for sharing

@AbhishekGhosh

This comment has been minimized.

AbhishekGhosh commented Jul 3, 2016

@petertom51 : I hope that you already got the fix. You will need to adjust Preferences > colors > minimum contrast, Preferences > colors > color boost, Preferences > colors > minimum contrast & Preferences > window > transparency to get all the colors. This can happen when display is not hardware calibrated and you need exact Solarized Dark color palate. Color palate was composed on calibrated machine. More you will decrease the transparency, the difference of colors will get vanished. You are using a minimum contrast of more than 50% -- text became white.

untitled 6

@Arasthel

This comment has been minimized.

Arasthel commented Aug 3, 2016

@AbhishekGhosh @petertom51 I just wanted to add that the main problem I had with the duplicate color came from window transparency. This solved it for me: Preferences > Profiles > Window > Window Appearance > Keep background colors opaque.

@poma

This comment has been minimized.

poma commented Aug 9, 2016

Those arrows are a hell for perfectionist. This is as close as I was able to get to pixel perfect stacking. Menlo sizes 13/12. In most examples here corners are even worse.

screen-shot-2016-08-09-at-12 55 40

@jcrawford

This comment has been minimized.

jcrawford commented Aug 11, 2016

Thank you for this walk-through I love the look of this and will give it a run for a bit ;)

@vonera

This comment has been minimized.

vonera commented Aug 11, 2016

nice work, thank you. but I've noticed one problem:
If the auto suggestions do not appear to show...
For Solarized Dark don't change the value of Black Bright as suggested above. This will affect the Solarized colorscheme in vim.
Instead, use ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE as described here. You can use any number between 0 and 255 (default is 8)
e.g.
echo ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=\'fg=60\' >> $ZSH_CUSTOM/zsh-autosuggestions_custom.zsh

@timwis

This comment has been minimized.

timwis commented Aug 14, 2016

This is great! Note the first time I went through this, I didn't realize you had to change the font in both places: the default font and also the font for non-ascii text. If you don't do that, the git symbols show up as question marks.

@PieterxJan

This comment has been minimized.

PieterxJan commented Aug 25, 2016

Is there any way to shorten the prompt, but only strip off the hostname?

So it would be nice to get this:

⚡ root > ~ > or pieterjan > ~ >

@wzulfikar

This comment has been minimized.

wzulfikar commented Aug 26, 2016

Thanks a lot Kevin! Really appreciate it :)

@ZarubinArtem

This comment has been minimized.

ZarubinArtem commented Aug 28, 2016

Hi Kevin!
Can not understand what's went wrong and what I need to do to fix it. Can you help me?

Image and video hosting by TinyPic

@jholguin-quamto

This comment has been minimized.

jholguin-quamto commented Sep 9, 2016

Wonderful tool, nice job Thanks

@venkateshk

This comment has been minimized.

venkateshk commented Sep 14, 2016

Hi All, I am seeing a weird symbol at the beginning of my prompt which doesn't go away with any of the themes. I see it only with iterm2 but not other terminal apps. Can someone please help me to get rid of it. I even tried resetting iTerm2 but no luck.

screen shot 2016-09-13 at 6 57 14 pm

screen shot 2016-09-13 at 7 04 13 pm

@marines

This comment has been minimized.

marines commented Sep 19, 2016

@venkateshk it's iTerm's feature.

@fwuensche

This comment has been minimized.

fwuensche commented Oct 3, 2016

Thanks @kevin-smets! This gist should be part of zsh wiki.
I chose a different color scheme - Neutron. Just wanted to share it here.

screen shot 2016-10-03 at 1 03 44 am

@hiberabyss

This comment has been minimized.

hiberabyss commented Oct 3, 2016

@venkateshk There should be line like source "${HOME}/.iterm2_shell_integration.zsh" in your .zshrc, removing that line can resolve your problem.

@todofixthis

This comment has been minimized.

todofixthis commented Oct 4, 2016

Most comprehensive guide to setting up iTerm2 key mappings that I've seen so far:
http://stackoverflow.com/a/29403520/

Uses ASCII control codes to perform certain actions universally (no more having to synchronize .inputrc, .vimrc, etc.).

Nice supplement to the Word Jumps section in the gist, and should address some of the issues other commenters have run into.

@ajnarayan

This comment has been minimized.

ajnarayan commented Oct 6, 2016

I am only getting a single color (default: Violet) for the arrows. How can I change its color?

@GinoPane

This comment has been minimized.

GinoPane commented Oct 10, 2016

Great!
But everything works fine for git folders with no uncommited changes in them. If folder contains something modified, then the circle is shown, like that:
image

What should I do to fix that?
Thanks.

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Oct 15, 2016

This is not a bug, this means you have changes which are not staged for a commit. Running git add . will turn the circle into a plus sign. Every symbol has its meaning.

@yudisupriyadi123

This comment has been minimized.

yudisupriyadi123 commented Oct 23, 2016

i want to use this Meslo font in my linux. How about the license? Is it free?

@Nuruddinjr

This comment has been minimized.

Nuruddinjr commented Oct 27, 2016

I want use Terminal ( not iTerm) is there any guideline to install this theme?

@mitrpaka

This comment has been minimized.

mitrpaka commented Oct 29, 2016

@PieterxJan Override prompt_context in your .zshrc file as follows to show only username (without machine name)

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

This comment has been minimized.

liutf commented Nov 5, 2016

very nice ! tkx!

@ibihim

This comment has been minimized.

ibihim commented Nov 10, 2016

This is awesome, but does someone know how to add the time to the right side and start the prompt on a new line?
I would love to merge agnoster's left part and bureau's right part 😄

@poctek

This comment has been minimized.

poctek commented Dec 31, 2016

Finally found how to remove the machine name from the prompt, thank you!

@nimmividya

This comment has been minimized.

nimmividya commented Jan 1, 2017

Wow! Thanks a lot. Now I can enjoy working with git.

@HristoEftimov

This comment has been minimized.

HristoEftimov commented Jan 3, 2017

How to make my PROMP to show only the folder name, not the directory path:
screen shot 2017-01-03 at 12 36 43 pm

When I call echo $PROMPT it shows me:

%{%f%b%k%}$(build_prompt)

Thanks!

@wendingp

This comment has been minimized.

wendingp commented Jan 4, 2017

Where can I find the Colors Tab in iTerm?

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Jan 9, 2017

@luc815689327 you can get there by going to preferences -> profiles -> colors

@oychao

This comment has been minimized.

oychao commented Jan 10, 2017

Mark & stared

@mryechkin

This comment has been minimized.

mryechkin commented Jan 16, 2017

This is fantastic. Thank you! Straight to starred

@shankarregmi

This comment has been minimized.

shankarregmi commented Jan 19, 2017

How to make my PROMPT to only show the current directory instead of long directory path name ?
@kevin-smets

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Jan 19, 2017

@aaronroberson

This comment has been minimized.

aaronroberson commented Jan 19, 2017

For my setup I had to git clone powerlevel9k to a different directory:
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/themes/powerlevel9k

@dritter

This comment has been minimized.

dritter commented Jan 19, 2017

@shankarregmi if you use powerlevel9k, you could set POWERLEVEL9K_SHORTEN_DIR_LENGTH=1. That shortens your path to the last directory.

The strength of powerlevel9k is its flexibility. Have a look at what others build with it.

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Jan 20, 2017

@dritter, thanks for that!

@shankarregmi

This comment has been minimized.

shankarregmi commented Jan 21, 2017

Thanks @dritter, I have my awesome looking iTerm2
Thank you @kevin-smets

@FranklinYu

This comment has been minimized.

FranklinYu commented Feb 7, 2017

I met an issue when using iTerm2 with theme "agnoster". My "tab completion" will shift the entire line left by a character:

tab-completion

Within Git repository this gets even worse:

tab-completion-with-git

This issue doesn't appear in Terminal.app. It only happens if it can't decide the completion and show all the possibilities; everything is fine when there is only one completion choice (and Zsh follows the choice).

update

Problem solved by unckeck "Preferences -> Profiles -> Text -> Unicode -> Treat ambiguous-width characters as double width (not recommended)." I must have been drunk to check this checkbox.

@atajwala

This comment has been minimized.

atajwala commented Feb 7, 2017

EDIT: Found the root-cause. Solarized dark theme was not displaying gray correctly. More info if interested - mochajs/mocha#802

First off - fantastic scheme! Thanks much!
I am not seeing certain console output after setting this up. These outputs are not visible unless they are highlighted (see below):

screen shot 2017-02-07 at 11 11 14 am

after highlighting:
screen shot 2017-02-07 at 11 11 36 am

any idea what could be causing this?

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Feb 10, 2017

@atajwala, it's an issue with the Solarized theme, a patched version can be found here: https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/Solarized%20Dark%20-%20Patched.itermcolors

I've made it the default one now. More info on the specific issue: mbadolato/iTerm2-Color-Schemes#62

//edit: missed the edit that mentioned you already fixed it dammit :)

@agnelantony2

This comment has been minimized.

agnelantony2 commented Feb 19, 2017

How do I display icons ? Trying to get mac icon displayed, but it shows OSX
screen shot 2017-02-19 at 11 29 33 am

@dritter

This comment has been minimized.

dritter commented Feb 23, 2017

@agnelantony2 Here is a tutorial for a pre-patched font:

  1. You need a compatible font
  2. Set the correct POWERLEVEL9K_MODE="awesome-patched" at the top of your ~/.zshrc
  3. Restart your shell (or source your ~/.zshrc)
@shangxor

This comment has been minimized.

shangxor commented Feb 28, 2017

There seems to be an issue with conda environments. From what I have seen in the powerlevel9k.zsh-theme file, there are functions defined for anaconda, virtualenv and pyenv.

I have modified the prompt_anaconda() and changed the path as follows:
_path=$CONDA_ENV_PATH$CONDA_PREFIX
_path=$CONDA_DEFAULT_ENV

This does not seem to work, and the conda env name does not get displayed at the beginning of the PROMPT.

Anyone has an idea how to fix this ?

@dritter

This comment has been minimized.

dritter commented Mar 1, 2017

@shangxor Could you report that on the powerlevel9k bug tracker?

@shangxor

This comment has been minimized.

shangxor commented Mar 1, 2017

@sogeniusio

This comment has been minimized.

sogeniusio commented Mar 5, 2017

Not sure if this was touched on, as I can't find anything on this online. My zsh integration didn't work as I had expected. See the screenshot.

Any ideas?

screen shot 2017-03-04 at 11 43 10 pm

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Mar 5, 2017

@sogeniusio that looks like you're not selected the powerline font as your terminal font. It needs to be a patched font, otherwise the symbols will show up, well.. like that :).

@iamethicker

This comment has been minimized.

iamethicker commented Mar 6, 2017

Hi guys,

might be a stupid question but did not find so far the answer.
How can I get colored folders when using ls, similar to ls -G ?
Thanks a lot

@jlira2

This comment has been minimized.

jlira2 commented Mar 8, 2017

This did not work for me. using MacOS sierra. installed iTerm2, got the color settings, installed Oh My Zsh, changed ~/.zshrc file to ZSH_THEME="agnoster" installed font, console changed colors and font but I did not get the colored arrows.

yes i did restart the console, command + Q and all.

@igbrahul96

This comment has been minimized.

igbrahul96 commented Mar 12, 2017

HOW DO I REMOVE THIS THEME! IT IS STUCK TO MY TERMINAL I WANT IT GONE

@pustovalov

This comment has been minimized.

pustovalov commented Mar 15, 2017

I used this color scheme Solarized Dark theme (patched version to fix the bright black value), but looks different:

how can I fix it?

@dritter

This comment has been minimized.

dritter commented Mar 18, 2017

@iamethicker you are searching for dircolors

@jlira2 did you select the newly installed font in the iTerm2 settings (profiles/text)?

@sirasao2

This comment has been minimized.

sirasao2 commented Mar 30, 2017

can someone please help me remove this theme.

@mitrx

This comment has been minimized.

mitrx commented Apr 2, 2017

@poma, try Source Code Pro for Powerline, 14. It seems to be perfect:
screen shot 2017-04-03 at 02 25 36

@mitrx

This comment has been minimized.

mitrx commented Apr 3, 2017

As @vonera mentioned, if you want to fix colours of autosuggestions don't use the solarized dark theme presented here.
To achieve the same effect as that theme does you should set ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE to 'fg=10' in you .zshrc. Precisely, you should add
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
to your .zshrc.

@hrafnkellpalsson

This comment has been minimized.

hrafnkellpalsson commented Apr 5, 2017

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Apr 13, 2017

Thanks for the suggestions and fixes @mitrx & @hrafnkellpalsson, I adjusted the readme to reflect them.

@edgar-costa

This comment has been minimized.

edgar-costa commented Apr 18, 2017

I installed everything and seems to work fine, however there is something I dislike and I do not manage to change. Everything looks very grey, when I do ls everything has the same color (I am used to see some rich colors with ubuntu normal bash), the prompt has the same colors than command outputs. I do not manage to add more rich colors, i tried with multiple themes and I always get one color for everything.

screen shot 2017-04-18 at 15 04 27

Also, is there a way to keep the theme, and setting when you ssh into another computer?

@Antairez

This comment has been minimized.

Antairez commented Apr 26, 2017

image
What are these numbers for, and how do I make use of them?

Thanks for the tutorial by the way, nicely written and liking this setup so far.

@jacobgarcia

This comment has been minimized.

jacobgarcia commented May 3, 2017

For the people asking about to show only the current path, do this:

  1. Open this directory ~/.oh-my-zsh/themes
  2. Open the agnoster.zsh-theme file with any text editor
  3. Go to the prompt_dir() function
  4. Replace the line in the function with this: prompt_segment blue black '%c'

Done. Now the theme only shows the current path.

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented May 3, 2017

@Antairez these are exit codes (the 127 in red) and the number of your command. This is built into powerlevel9k, check out how to configure it here: https://github.com/bhilburn/powerlevel9k

@patriciojofre

This comment has been minimized.

patriciojofre commented May 11, 2017

thanks!

@jerryjohnjacob

This comment has been minimized.

jerryjohnjacob commented May 24, 2017

Brilliant! Great job!

@Purple90

This comment has been minimized.

Purple90 commented May 24, 2017

I am having trouble getting this to work with iTerm. After I make the changes, the i just get blue boxes with '?' in it. Any suggestions?
itermustom

edit: Solution is -> https://gist.github.com/agnoster/3712874#gistcomment-2032070

@Kiodaddy

This comment has been minimized.

Kiodaddy commented Jun 14, 2017

Great script its working fine.

@frankgraave

This comment has been minimized.

frankgraave commented Jun 19, 2017

First of all, great theme! I love it!
But, how do I get some more space between the branch icon and branch name?
Picture: https://puu.sh/woF2w/0df35ca0cb.png

Thanks!

@AxelBriche

This comment has been minimized.

AxelBriche commented Jul 4, 2017

Thanks!

@sathish-2000

This comment has been minimized.

sathish-2000 commented Jul 11, 2017

Awesome dude....
Brilliant....
Thanks!

@knaveenr

This comment has been minimized.

knaveenr commented Jul 23, 2017

Thank you!, Nice and simple work

@gohilurvish

This comment has been minimized.

gohilurvish commented Jul 28, 2017

I made 75% of this working the day before by going around the sites and fiddling with keyboard.
This one the most cleanest one!!!

Thank You...

@se-jaeger

This comment has been minimized.

se-jaeger commented Aug 5, 2017

@kevin-smets you can improve the word jump section. See: https://apple.stackexchange.com/a/293988 If you want, feel free to use my revision: https://gist.github.com/se-jaeger/bf2d8992ccee0eb9f954fe05442c8c7d

Nevertheless very good job! Thank you.

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Aug 7, 2017

@se-jaeger that thing is a game changer 👍 Thanks!

@kashishgrover

This comment has been minimized.

kashishgrover commented Aug 9, 2017

Thanks a lot for this. Cheers. 😄

@andrewkusuma

This comment has been minimized.

andrewkusuma commented Aug 30, 2017

@Antairez are you try to iterm2 > Preferences > Profile > Text > uncheck 'draw bold text in bright colors' ?

@jameel263

This comment has been minimized.

jameel263 commented Sep 10, 2017

@frankgraave I have the same problem. Were you able to figure out what was causing the lack of spacing?

@ekenigs

This comment has been minimized.

ekenigs commented Sep 15, 2017

If someone is using a terminal in VSCode and has an issue with a font. You can add this line to your VSCode config:

"terminal.integrated.fontFamily": "Meslo LG M for Powerline",
@sriramab

This comment has been minimized.

sriramab commented Sep 19, 2017

Changing this with iTerm changed my Terminal View (ctrl+alt+t) in Eclipse. It has all the strange colours and hardly visible. Anybody has a similar experience? I would like to get this view in Eclipse or return back to it default. Please let me know.

@rfyiamcool

This comment has been minimized.

rfyiamcool commented Oct 21, 2017

+1

@kagarlickij

This comment has been minimized.

kagarlickij commented Nov 4, 2017

@ekenigs I've faced the same issue, but after adding
"terminal.integrated.fontFamily": "Meslo LG M for Powerline",
it still looks bad - http://prntscr.com/h665d7
any ideas how it can be fixed?

@ghost

This comment has been minimized.

ghost commented Nov 10, 2017

Wow, thank you!

@cxrod

This comment has been minimized.

cxrod commented Nov 15, 2017

@mikesilence @HristoEftimov
just add POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 to your .zshrc

@marcko

This comment has been minimized.

marcko commented Nov 19, 2017

Nice, Thank you !!

@jacobnoori

This comment has been minimized.

jacobnoori commented Nov 21, 2017

Thanks for the excellent guide!

@matisnape

This comment has been minimized.

matisnape commented Dec 13, 2017

@ekenigs I have the same issue as @kagarlickij - could someone help? iTerm works fine.

@LiuZhiyan

This comment has been minimized.

LiuZhiyan commented Jan 23, 2018

Hi guys, why I have "⍟3" suffix in the prompt, how can I remove/fix it? Any idea? Thanks a lot.

image

@HisagiKaze

This comment has been minimized.

HisagiKaze commented Jan 29, 2018

Thanks man, you're the best

@stevehealy

This comment has been minimized.

stevehealy commented Feb 8, 2018

Having problems installing the Meslo font on Mac (High-Sierra). Any ideas?

image

EDIT: Installing the fonts using these instructions worked perfectly...
https://github.com/powerline/fonts

@ekenigs

This comment has been minimized.

ekenigs commented Feb 12, 2018

@kagarlickij and @matisnape sorry but I don't know what could be the issue. I just did what I said and had no issues.

@Cyhar

This comment has been minimized.

Cyhar commented Feb 14, 2018

Hi,

If someone want to uninstall (please read before) : https://github.com/robbyrussell/oh-my-zsh/blob/master/tools/uninstall.sh
thanks the author @robbyrussel ! (https://github.com/robbyrussell)

@PK85

This comment has been minimized.

PK85 commented Feb 18, 2018

Thanks Kevin :)

@philippeboyd

This comment has been minimized.

philippeboyd commented Feb 27, 2018

@LiuZhiyan it means you have 3 items in your stash (git stash list)

@LiuZhiyan

This comment has been minimized.

LiuZhiyan commented Mar 1, 2018

Cool thanks! @philippeboyd btw, do you know any doc I can check for these available suffix?

@send2deb

This comment has been minimized.

send2deb commented Mar 17, 2018

Thanks for sharing this. I followed your instructions and my iTerm2 now looks awesome! Thanks very much indeed!

@Wayne82

This comment has been minimized.

Wayne82 commented Apr 5, 2018

Thanks for sharing, this is great!

@PsCustomObject

This comment has been minimized.

PsCustomObject commented Apr 8, 2018

Thanks a lot for sharing this I was not even aware it was possible but finally my term window is looking exactly as I want it!

Thank you so much!

@roubee

This comment has been minimized.

roubee commented Apr 24, 2018

Thanks for sharing! That's helped a lot :)

@KORraNpl

This comment has been minimized.

KORraNpl commented Apr 24, 2018

@zz31415

This comment has been minimized.

zz31415 commented Apr 27, 2018

@petertom51 I just solved it by setting color minimum contrast to 0.

@kevin-smets

This comment has been minimized.

Owner

kevin-smets commented Apr 27, 2018

Thanks @KORraNpl, fixed the link!

@muthash

This comment has been minimized.

muthash commented May 7, 2018

Hi, thanks a lot for this. Is there a way to show if one enters a virtualenv and still maintain the above configurations?

@andrepcg

This comment has been minimized.

andrepcg commented May 15, 2018

image

For some reasons some console outputs look weird, I don't know what's causing this.

@luyang950

This comment has been minimized.

luyang950 commented May 29, 2018

Cool!
Thank you so much

@matuella

This comment has been minimized.

matuella commented Jun 5, 2018

10/10

@sandipsubedi

This comment has been minimized.

sandipsubedi commented Jun 11, 2018

Thank is awesome ! Thank you so much 🏆 👍

@LuongPV

This comment has been minimized.

LuongPV commented Jun 15, 2018

@kevin-smets You're awesome!
You made a series of complete tutorial about this.
Thanks so much!

@equiman

This comment has been minimized.

equiman commented Jul 18, 2018

@antaires it the terminal history number assigned to this command.

You can rerun the same command prefixing ! to the desired command.
Example !7530 reruns cd test command

@snehasi

This comment has been minimized.

snehasi commented Jul 20, 2018

Thanks, you're a black magician. wooooo 👯

@griffincox

This comment has been minimized.

griffincox commented Jul 22, 2018

FYI for those using vscode: I needed the following two lines in the vscode user config (cmd + ,):

 "terminal.integrated.shell.osx": "zsh",
 "terminal.integrated.fontFamily": "Meslo LG M for Powerline",
@robie2011

This comment has been minimized.

robie2011 commented Aug 28, 2018

Thank you 👍

@muraleo

This comment has been minimized.

muraleo commented Sep 10, 2018

Very helpful! Thank you!

@thimansh

This comment has been minimized.

thimansh commented Oct 2, 2018

Thanks for this!

@ar2zee

This comment has been minimized.

ar2zee commented Oct 11, 2018

Hello , Thank you first of all. But can anybody help me please.
How to change the transparent color of git plugin in zsh to red or something else lie in 1st image. Thank you
screen shot 2018-10-11 at 11 20 04
screen shot 2018-10-11 at 11 19 54

@Khord

This comment has been minimized.

Khord commented Oct 12, 2018

Anyone know how to get Powerline fonts to work in Mojave?
image

@vladyn

This comment has been minimized.

vladyn commented Oct 30, 2018

screenshot 2018-10-30 at 16 45 35

it's weird or I'm mistaking something, but I did all the steps and I have no change in the oh-my-zsh theme. I'm able to change only the font and color scheme from iterm2 preferences. my .zshrc looks like this:
ZSH_THEME="powerlevel9k/powerlevel9k"
#DISABLE_AUTO_TITLE="true"

POWERLEVEL9K_BATTERY_CHARGING='yellow'
POWERLEVEL9K_BATTERY_CHARGED='green'
POWERLEVEL9K_BATTERY_DISCONNECTED='$DEFAULT_COLOR'
POWERLEVEL9K_BATTERY_LOW_THRESHOLD='10'
POWERLEVEL9K_BATTERY_LOW_COLOR='red'
POWERLEVEL9K_BATTERY_ICON='\uf1e6 '
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='\uf0da'
#POWERLEVEL9K_VCS_GIT_ICON='\ue60a'

POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='yellow'
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow'
#POWERLEVEL9K_VCS_UNTRACKED_ICON='?'


POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status os_icon battery context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(time background_jobs ram virtualenv rbenv rvm)

POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=4

#POWERLEVEL9K_CUSTOM_TIME_FORMAT="%D{\uf017 %H:%M:%S}"
POWERLEVEL9K_TIME_FORMAT="%D{\uf017 %H:%M \uf073 %d.%m.%y}"

POWERLEVEL9K_STATUS_VERBOSE=true

POWERLEVEL9K_PROMPT_ON_NEWLINE=true

and I do have the powerlevel9k cloned in my .oh-my-zsh/custom/themes

@lbighetti

This comment has been minimized.

lbighetti commented Dec 6, 2018

Thanks for this! Been using this guide and recommending it to people who see my terminal for a while now! Cheers!

@alexfmpe

This comment has been minimized.

alexfmpe commented Dec 9, 2018

@kevin-smets In section "Auto suggestions (for Oh My Zsh)":
"iTerm → Preferences → Colors tab" is missing "Profiles"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment