Fix vim after upgrading to yosemite
After I upgraded to OSX Yosemite vim started behaving strangely. For instance set clipboard=unnamed
was no longer working. This is because yosemite came with it's own version of vim compiled without clipboard support.
To fix it, uninstall the system vim:
sudo rm /usr/bin/vim
Then reinstall vim with homebrew
brew install vim
Written by Christian Schlensker
Related protips
1 Response
I wouldn't recommend removing the system vim outright. What I do is detect the most recently modified version of vim and set that to the EDITOR variable (and then alias the vim command to it)
find_vim()
{
local IFS=$'\n'
local vim
for vim in $(whence -ap vim); do
if [[ -z $BEST_VIM ]] || [[ $vim -nt $BEST_VIM ]]; then
export BEST_VIM=$vim
fi
done
}
find_vim
if [[ -n "$BEST_VIM" ]]; then
export EDITOR="$BEST_VIM"
fi
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Osx
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#