Macvim lags while Vim on terminal is buttery smooth

4

1

I am running OS X Lion 10.7.3 and Macvim runs significantly slower than vim on the terminal for me. All movement commands in Macvim are much slower. Moving up and down in visual mode is equally as laggy. I see none of this lag when using vim from the terminal. Does anyone know what the reasons may be? I am running NERDtree on every open tab, and I know this contributes some memory overhead and potentially some slow down; but even when I don't run NERDtree Macvim runs much slower than vim from the terminal. Any help in solving this would be greatly appreciated.

SaamJB

Posted 2012-05-30T02:31:20.030

Reputation: 51

Please add a list of the plugins in your ~/.vim/ folder. – romainl – 2012-05-30T05:56:46.997

Answers

1

I have no diagnosis for the problem, but reinstalling (potentially updating to a newer version, I don't remember which version I was previously running) MacVim solved almost all of the lag. It isn't quite as fast as Vim on the terminal, but this is to be expected. It is no longer unbearably slow.

SaamJB

Posted 2012-05-30T02:31:20.030

Reputation: 51

4

The first thing to do is to start MacVim with mvim -u NONE -U NONE --noplugin, which will prevent any startup files from running. If it is no longer slow to respond, you have a configuration problem somewhere.

Heptite

Posted 2012-05-30T02:31:20.030

Reputation: 16 267

How do I launch macvim this way? – SaamJB – 2012-05-30T05:00:15.170

1@SaamJB, MacVim is distributed with a CLI script called mvim. In the terminal, type /path/to/where/you/have/put/mvim -u NONE -U NONE --noplugin. – romainl – 2012-05-30T06:10:05.903

I am experiencing the same issues myself and launching without plugins causes a huge speedup. Are there any good ways to narrow done which plugin is causing this bar placing them back in one by one? – Patrick O'Doherty – 2012-06-20T21:06:19.330

3

The Vim you are running in Terminal.app is probably the default Vim provided by Apple. It is built with much less features than MacVim so it's starting and working much faster.

Is MacVim slow in every occasion? When editing any filetype? Only for some filetypes?

Vim is notoriously prone to slowdown when syntax-highlighting very long lines, would that be the case here? Is vim still slow after :syntax off?

Some other things known for slowing down Vim are :set cursorline and :set cursorcolumn.

romainl

Posted 2012-05-30T02:31:20.030

Reputation: 19 227

Doing syntax off definitely, makes MacVim file navigation faster. – r3bo0t – 2017-10-23T06:24:09.470

I tried this before reinstalling and it didn't solve the issue. Thanks for the help though. – SaamJB – 2012-05-30T22:17:38.363

1

My problem was mainly that MacVim opened, read, and wrote especially slowly (sometimes upward of 15 seconds). mvim --startuptime revealed that sourcing files from .vimrc and the runtime/ directory was taking most of the time, and the problem was solved by adding the line:

set rtp+=/usr/local/Cellar/macvim/7.4-73/MacVim.app/Contents/Resources/vim

As you can see, I am using a Homebrew install of MacVim, and accordingly you should make sure you enter the correct path and version number.

katriel

Posted 2012-05-30T02:31:20.030

Reputation: 155