Setting up OSX Terminal and Vim

Matthew Glover
Jul 24, 2017 · 2 min read

I recently got a new/old work Macbook, with a fresh install of OSX Sierra. After putting up with the system defaults for a few weeks, I have finally had enough of making do and am trying to get a nice terminal and Vim setup.

Iterm 2 with the Nova colour scheme

I’m using iTerm 2 in place of the standard OSX terminal, which is straightforward to install. And I’ve modified it to use the Nova colour scheme, which not only looks good but has clear, helpful installation instructions.

Fish Shell and Oh My Fish

Having previously used Zsh (more specifically Oh My Zsh), this time I’ve decided to use the Fish shell, which seems to have some nice additional features that I’m only just starting to discover. In the absence of any strong personal convictions on configuration, I found this guide on how to setup Fish with Oh My Fish with the Agnoster theme. The article suggests installing the Menlo font, but I’ve not done this yet and so far haven’t run into any issues using the iTerm default font settings. Installation with Homebrew was very quick and simple. Everything working just as promised.

Installing Vim

Having made do with the system Vim, I realised it’s limitations when I tried to install the Nova colour scheme for Vim, which led to this error: E518: Unknown option: termguicolors. Google led me to this issue, which explains that I needed to be running Vim 8 rather than the Vim 7 version that comes with OSX.

Installing Vim 8 is usually straightforward with Homebrew: brew install vim -with-override-system-vim, but when I opened Vim I still had the same error and, when I checked which vim, I was still using usr/bin/vim which is the System Vim and not the Homebrew Vim, which should be at usr/local/bin/vim.

Adding to the System Path

Before now I have fixed this kind of issue by ensuring that the PATH looks in usr/local/bin before it check usr/bin (so by default a Homebrew package will override anything installed by the system). Indeed, when I checked the current PATH, using the commandecho $PATH, I got back: usr/bin /bin /usr/sbin /usr/local/bin, which means calling vim would always return the System Vim.

In Zsh, adding /usr/local/bin to the head of the PATH variable is just a matter of adding the following to my ~/.zshrc file: export PATH=/usr/local/bin:$PATH. But Fish does things differently. To achieve this, I checked the helpful fish docs, which explained I needed to run the following: set PATH /usr/local/bin $PATH. This is the same principle as Zsh, but just slightly different syntax.

Once I’d done this, I could check the version of vim by running vim —-version, which confirmed I was running Vim 8, and which vim, pointed to usr/local/vim/bin.

Now I have the basics in place, I can start to add plugins and customise settings.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade