I recently discovered that Vim 7.4 enables a hybrid number mode, such that if you do set nu
and set rnu
, you'll see the absolute line number of the current line and relative line numbers everywhere else (see here and here). I set this up on a Linux machine and it works great. Unfortunately it's not working on my Mac (El Capitan). If I type :set rnu
I'll get relative numbers with 0 at the cursor line, and if I then type :set nu
it will switch to only absolute line numbers, unlike what I see on the Linux machine. I have Vim 7.4 installed via Homebrew. How do I get this to work? Do I need to reinstall with some particular setting?
Vim 7.4 hybrid line numbers not working (installed via Homebrew)
homebrewvi
Related Question
- MacOS – ‘which openssl’ returns nothing when trying to upgrade OpenSSL
- MacOS – How to rename formula installed via Homebrew
- MacOS – How to move the cursor past the end of the line in Insert mode when using vi-style line editing on bash
- Terminal Tab Names – Setting Terminal Tab Names in OS X and Using Vim
- MacOS – Vim mappings not working in OS X
- Terminal Bash Homebrew – Make Homebrew Installed Vim Override System Vim
- Imagemagick installed via Homebrew, convert missing
Best Answer
It turns out the problem was not with Vim 7.4, Homebrew, Macs, or any combination of the 3. Just my brain. I was used to
vi
pointing to thevim
that I want, but in my casevim
points to the Homebrewed version andvi
points to the version originally on my Mac, which was Vim 7.3. I usually usevi
andvim
interchangeably and that shot me in the foot here. I havevi
aliased to the Homebrewed Vim now and everything is dandy.