Macos Vim Color



MacOS is awesome for command line stuff, that’s why real Java programmers love it. But some of the defaults Apple have used make me sad. Where are all the colors? I demand my ls command be pretty and colorful! Why is Vim so bland?

Just wanted to point out to that Terminal supports 256 colors just fine and has done for the past few releases of OS X. Im using Mavericks (10.9) so its probably true in Yosemite (10.10) too. Unfortunately, it doesn't work inside GNU screen, because the version of screen that ships with OS X (at least in 10.9) doesn't have 256-color support. Ben Schmidt wrote: I do the Vim.app the same way and it works with symlinks. It is a more typical Vim installation that stores its runtime files outside the bundle, IIRC, and thus plays nicer with Unix tricks like symlinking.

MacOS is awesome for command line stuff, that’s why real Java programmers love it. But some of the defaults Apple have used make me sad. Where are all the colors? I demand my ls command be pretty and colorful!

Why is Vim so bland?

I have seen several options on the web on how to adjust colors but some, albeit very good ones, make me uncomfortable with the type of installations that have to be performed in order to enable these themes.

So, after some digging and reading man pages on terminal coloring and ls I found a super-simple solution for decent terminal coloring.

If you have below questions then you are at right place:

  • Simple Tricks to Improve the Terminal Appearance
  • how do you change mac terminal theme
  • mac terminal color ls
  • change terminal color linux
  • Customize the colors of your Terminal in MacOS
  • Customizing the Terminal
.vimrc

Let’s get started.

Option-1)

Step-1.

Open Terminal Window. You should see the color scheme like this:

Step-2.

Command: $ vi ~/.bash_profile and Enter Below lines and save file.

Macos Vim Color
2
4
6
export CLICOLOR=1
export GREP_OPTIONS='--color=auto'

Step-3.

Command: $ source ~/.bash_profile to initialize profile in current window.

You should see color now:

  • CLICOLOR=1 simply enables coloring of your terminal.
  • LSCOLORS=… specifies how to color specific items.

Step-4.

Add some more coloring. Keep previously added lines and add these extra lines. This gives you a nice colored prompt.

2
PS1='[e[0;33m]u[e[0m]@[e[0;32m]h[e[0m]:[e[0;34m]w[e[0m]$ '
Vim

And you should see color for username and command line prompt:

Option-2)

  1. Open terminal window
  2. Click on Terminal Menu
  3. Click on Preference
  4. Modify profile as per below image
  5. Select profile for
    • On startup, open:
    • New windows open with
    • New tabs open with

I hope this helps you change terminal window colors easily.

Join the Discussion

If you liked this article, then please share it on social media. Still have any questions about an article, leave us a comment.

Mac Os Vim Color Setting

Other Popular Articles...





Comments are closed.