-
-
Notifications
You must be signed in to change notification settings - Fork 682
FAQ
Download MacVim.dmg
from latest binary release page, open the .dmg
file, and copy MacVim.app
to /Applications
. See Installing.
If you would like to use a package manager instead, you can use Homebrew to install MacVim. Simply download Homebrew and do brew install macvim
.
All settings should be saved in a file named .gvimrc
which must be located in
your home folder (abbreviated ~/
). Note that you have to create this file if
one does not already exist. Your home folder is the one called /Users/name
where name
is your login name. Type :h vimrc-intro
for more information on
Vim configuration files.
Add the line set guifont=Monaco:h14
to your .gvimrc
to set Monaco as the default font with a size of 14.
Add the line set lines=40
to your .gvimrc
to make 40 the default number of
rows. To set the default number of columns to 100 add the line set columns=100
.
If you want the window as big as possible, you can set these options to very
large values or you can type :set lines?
and :set columns?
after having
manually maximized the window to find out how big it is and then add these
values to your .gvimrc
.
Note that the dimensions of the first window you open are automatically saved and used for every window you open thereafter.
Hold down Cmd when clicking the green zoom button. If you want this to be the default behavior, open Terminal and enter
$ defaults write org.vim.MacVim MMZoomBoth 1
The easiest way is using Homebrew https://brew.sh/. Install Homebrew and brew install python3
, brew install ruby
, or brew install lua
.
You can use any distribution of Python/Ruby/Lua dylib binaries as long as those versions are the same as the MacVim binary supported version. You may need to set up your .vimrc like following.
set pythonthreedll=/opt/Python3.6.3/Frameworks/Python.framework/Versions/3.6/Python
set rubydll=/opt/Ruby2.4.1/lib/libruby.2.4.dylib
set luadll=/opt/Lua5.2.1/lib/liblua.dylib
In Xcode, open the Preferences and click the "File Types" tab, then expand "file -> text". Under the "text" item there is an entry called "sourcecode"; click the second column (Preferred Editor) of this entry and choose "External Editor -> Other". Navigate to MacVim in the dialog that pops up.
The "external editor" support in Xcode is very limited. Basically all the above change does is to open source code files in MacVim. You can also double click on build errors to open MacVim on the line where the error was reported.
Add the line set guioptions-=T
to your .gvimrc
file.
Add the line set backupcopy=yes
to your .gvimrc
file. Type
:h 'backupcopy'
for more information on why this is necessary.
Use the mvim
script (which is located in the MacVim.app
, like /Applications/MacVim.app/Contents/bin/mvim
.) Type :h macvim-start
for more information.
Add the following line to the file ~/.profile
:
export EDITOR='mvim -f --nomru -c "au VimLeave * !open -a Terminal"'
The --nomru
switch ensures that the commit message is not added to the Most
Recently Used file menu (requires Snapshot 57 or later). The -c ..
switch
ensures that Terminal gets focus again after closing the commit message. (Note
that you need to put the mvim
script path in your PATH environment for this to work.)
Open Terminal and enter
$ defaults write org.vim.MacVim SUEnableAutomaticChecks -bool false
(This is outdated information as of Mojave. CGLayer is deprecated. If you see black screen, file an issue)
Execute the following command in Terminal.app if you're using Use Core Text renderer
and Prefer native full-screen support
in Preferences
> Advanced
.
$ defaults write org.vim.MacVim MMUseCGLayerAlways -bool YES
Make sure you read MacVim's help page first by typing :help macvim
within MacVim, or here.
Please consult the Troubleshooting guide before asking for help! After doing so you may post your question to the vim_mac Google Group if it is MacVim related. General questions about using Vim should be posted to the vim_use Google Group.
Note that you do not need to subscribe to email notifications when signing up for either of these groups. You can read the groups online if you would rather keep your inbox clean. These groups are moderated so your first post may take up to a day before it arrives to the group (subsequent posts should show up within a few minutes).
Please read the guidelines before posting to either of these groups.
You can also file an issue if you cannot figure it out.