4

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.

  • Please add a list of the plugins in your ~/.vim/ folder. – romainl May 30 '12 at 5:56
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.

  • How do I launch macvim this way? – SaamJB May 30 '12 at 5:00
  • 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 May 30 '12 at 6:10
  • 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 Jun 20 '12 at 21:06
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.

  • I tried this before reinstalling and it didn't solve the issue. Thanks for the help though. – SaamJB May 30 '12 at 22:17
  • Doing syntax off definitely, makes MacVim file navigation faster. – r3bo0t Oct 23 '17 at 6:24
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.