I have MacVim installed and I am trying to set it up as the editor for Git (version control), but I can't run 'mvim' from the command line as it isn't recognised. How do I setup mvim so I can run it from Terminal?
Try to reinstall your macvim with option --with-override-system-vim. it will create vi and vim command under /usr/local/bin/ and if you want to open a file from terminal using macvim, just type vi file or vim file . These two commands acted as mvim -v . That's all.
Just select the file and hit Cmd-i, then go to the "Open with" tab, select app and hit "Change all...". This will change the default application for that file and the open command will work as you wish. Then you can type edit filename in Terminal and the file will open in MacVim.
How do I setup mvim so I can run it from Terminal? Try vim from the command-line. Disclaimer: this would work for Linux so I suppose it is similar on a Mac. Try to see the path (use " echo $PATH ") and add the folder to the MacVim executable to it if it's not there already (use " export PATH=$PATH:path/to/folder ").
I don't think I'd to add anything to the path, did
brew install macvim mvim -v
should then open macvim in the terminal, you can also go ahead and alias that
alias vim='mvim -v'
There should be a script named mvim in the root of the .bz2 file. Copy this somewhere into your $PATH ( /usr/local/bin would be good ) and you should be sorted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With