3

When I open vim (or gvim) on MacOS X, the window opens immediately, but there is a pause of about a second before the cursor appears. I've profiled my plugins, but their startup times don't account for the length of the pause:

ExecTime"   "PluginName"
42.126  "syntastic"
15.896  "unite.vim"
7.116   "vim-textobj-rubyblock"
6.77    "vim-fugitive"
6.653   "vim-easymotion"
4.707   "tabular"
1.787   "neomru.vim"
1.585   "vim-table-mode"
1.376   "tagbar"
1.106   "L9"
1.053   "vim-textobj-user"
1.042   "neoyank.vim"
1.027   "vim-surround"
0.679   "vim-exchange"
0.667   "Vundle.vim"
0.645   "neocomplete.vim"
0.512   "neosnippet.vim"
0.355   "vim-commentary"
0.321   "restore_view.vim"
0.187   "ag.vim"
0.167   "vimproc.vim"
0.15    "tern_for_vim"
0.115   "vim-javascript-syntax"
0.114   "scss-syntax.vim"
0.113   "vim-slim"
0.099   "vim-snippets"
0.077   "Rename"

If I use the --startuptime flag it produces a file 2 million lines long, and I don't know how to extract the relevant info.

What could be causing the problem? How else can I debug it?

Jonah
  • 743
  • 6
  • 15
  • If you are debugging plugins, then do: Disable half of your plugins. If it fixes the problem, re-enable half of the disabled ones. If it doesn't, disable half of the ones not yet disabled. Repeat until you have proven which plugin is the cause, or that none is. – jjaderberg Jan 29 '16 at 21:25
  • 1
    Your happy case is found by running vim -u NONE. If that does not suffer from the problem then there is something in your startup sequence that is causing it. You can extend the above bisection to your whole vimrc, in case you found that no plugin was the cause. See http://vi.stackexchange.com/questions/2003/how-do-i-debug-my-vimrc-file and http://vim.wikia.com/wiki/Bisecting – jjaderberg Jan 29 '16 at 21:27
  • vim -u NONE fixes the problem. however, commenting out even all of my plugins in .vimrc does not. where do i go from here? – Jonah Jan 29 '16 at 21:52
  • Disable half of the rest of your vimrc. If it fixes the problem, re-enable half of the disable part. If it doesn't, comment out... – jjaderberg Jan 29 '16 at 21:55
  • This happens when you open Vim without any filename arguments, or when you open Vim to edit a particluar file? If a particular file, can you describe the file? You should also inspect the output of :scriptnames to see what scripts have been run since you started Vim. Since vim -u NONE is OK, the culprit will be in there somewhere. – jjaderberg Jan 29 '16 at 21:58
  • 1
    @jjaderberg, thanks, that worked. The culprit was this line which I added recently and forgot about it: set lines=999 columns=9999 -- intended to auto-maximize vim on MacOS. I guess I should find another method... I'll accept your comment as an answer if you add it. – Jonah Jan 29 '16 at 22:05
  • @Jonah That should actually work... We have a Windows question for that, by the way, but no OSX question ... yet... ;-) – Martin Tournoij Jan 30 '16 at 00:11
  • @Carpetsmoker, oh it works, it just creates an annoying 1 second pause, even when it's already maximized. – Jonah Jan 30 '16 at 01:06

1 Answers1

4

If you are debugging plugins, then do the following:

Disable half of your plugins. If it fixes the problem, re-enable half of the disabled ones. If it doesn't, disable half of the ones not yet disabled. Repeat until you have proven which plugin is the cause, or that none is.

Your happy case is found by running vim -u NONE. If that does not suffer from the problem then there is something in your startup sequence that is causing it. If you find that no plugin was the cause, extend the bisection to the rest of your vimrc:

Disable half of the rest of your vimrc. If it fixes the problem, re-enable half of the disable part. If it doesn't, disable half of the not yet disabled part. Repeat until you have proven which part of your vimrc is the cause, or that none is.

If this happens when you open Vim o edit a particular file, then details of that file may be important. You should also investigate the output of :scriptnames to see what scripts have been run since you started Vim. If vim -u NONE is OK, the culprit will be in there somewhere.

Also see How do I debug my vimrc file? and http://vim.wikia.com/wiki/Bisecting.

jjaderberg
  • 3,489
  • 1
  • 14
  • 19