Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim Mac OS X install with gui-support

Tags:

vim

macos

macvim


I have Mac Pro, with OS X 10.9.4 (can't upgrade to Yosemite yet), and I'm trying to build vim7.4 with gui-support, or get any kind of gui-support. My current vim is version 7.3, I'm guessing, that's the default vim that ships with macs. I have the Terminal.app and iTerm2.app, my vim rc has the default

set term=xterm-256colors

or what have you.

What I have so far:

macvim

The colors look great, basically it's the same setup I had on my ubuntu system, but it's really annoying that it opens a new window. Is there a way to get it to open within my terminal? (not launch it from the terminal, open inside of it)

As I've said I have the regular vim7.3 And while I can use color-schemes, they look like garbage compared to my ubuntu system. I suppose this must be due to gui-support option? I tried, CSApprox but that gives me a weird error.

So I decided to simply build vim 7.4 and enable gui support, but I get random errors.
My basic config make looks like:

./configure --enable-gui=yes
make

At which point it complains about missing header file etc. , I figured this should not be that hard.

Any tips?

The basics of what I'm trying to do is:

Have a vim version installed with gui-support, or a work-around where my colors are all screwed up.

Thanks!

like image 415
janjust Avatar asked Sep 22 '14 16:09

janjust


People also ask

Can I install Vim on Mac?

Once we install Vim on our MacOS, we can use it for programming in any of the languages or for editing of any of the documents. To get started with the Vim, we either type simply vim on command line or we can open it via GUI by double clicking the vim icon shown in the Applications.

Is vim free for Mac?

Vim is free and open source software and is released under a license which includes some charityware clauses, encouraging users who enjoy the software to consider donating to children in Uganda.

How do I insert vi in Mac?

vi mode has two submodes: insert mode and command mode. The default mode is insert. You can toggle between the modes by pressing Esc; alternatively, in command mode, typing a (append) or i (insert) will return you to insert mode.

How do I find vim on my Mac?

The path used by macOS's default vim install is /usr/share/vim/vimrc .


2 Answers

Building Vim on Mac OS X is a waste of time.

Step 1: Download the appropriate MacVim build from here.

Step 2: Put MacVim.app into the /Applications/ directory.

Step 3: Put the bundled mvim script somewhere in your PATH.

Done.

To run MacVim in your shell:

$ mvim -v filename

To run MacVim from your shell:

$ mvim filename
like image 51
romainl Avatar answered Sep 19 '22 21:09

romainl


Building Vim with GUI on macOS using Homebrew:

  1. brew edit vim.
  2. Add a new line with option for GUI:

    option "enable-gui", "Enable GUI mode"
    
  3. Change from no to yes in the following line:

    opts << "--enable-gui=no"
    
  4. Install or re-install vim:

    brew reinstall vim --enable-gui
    

Troubleshooting:

  • If you've errors related to Python 3, see: vim's GH-2754.
  • Checkout new Homebrew PR at GH-25785 with above patch.
like image 38
kenorb Avatar answered Sep 19 '22 21:09

kenorb