Skip to content

Instantly share code, notes, and snippets.

@axoplasm
Last active January 29, 2018 09:55
Show Gist options
  • Save axoplasm/ca32decb8d7f4b1917a1d5e537153fc4 to your computer and use it in GitHub Desktop.
Save axoplasm/ca32decb8d7f4b1917a1d5e537153fc4 to your computer and use it in GitHub Desktop.
Set up wincent/command-t for both Vim & MacVim

I had trouble getting both Vim and MacVim to use the same Ruby executable, which is necessary to use the command-t plugin. The cannonical MacVim homebrew recipe hardlinks to /usr/bin/ruby while (terminal) Vim will use the system executable (whatever it is). If you install Ruby via homebrew it installs in /usr/local/bin/ruby.

Here's what I did:

$ brew install ruby # install most recent ruby (2.3.x)    
$ brew uninstall vim     
$ brew uninstall macvim     
$ brew install vim    
$ brew tap macvim-dev/macvim # dev branch of macvim, has better tap config    
$ brew edit macvim-dev/macvim/macvim    

So, editing that file:

# macvim-dev/macvim/macvim 39 :
'--with-ruby-command=/usr/local/bin/ruby', # point this line to the system ruby installed above    

then:

$ brew install --HEAD macvim-dev/macvim/macvim 

OK at this point both vim and macvim are using the brew-installed system ruby

Now build the c extension for command-t:

$ cd ~/.vim/bundle/command-t/ruby/command-t     
$ ruby extconf.rb     
$ make    
@igorb
Copy link

igorb commented Jan 29, 2018

it doesn't work with MacOS Siera :)

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