-
Notifications
You must be signed in to change notification settings - Fork 397
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
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.
Put the script mvim
which comes bundled with the MacVim download somewhere in
your path. 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 in your path for this to work.)
The problem is that MacOS uses zshenv incorrectly, forcing system
paths for non-login shell calls. This can be fixed by moving zshenv
to zprofile
:
sudo mv /etc/zshenv /etc/zprofile
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.