StartUp of Gvim is too slow

707 views
Skip to first unread message

niva

unread,
Jan 6, 2013, 12:19:58 PM1/6/13
to vim...@googlegroups.com
Hi,

I think it automd that make startup of X Gvim session to slow but how can I know that ?

by profiling ?

Thanks for your advises

Marc Weber

unread,
Jan 6, 2013, 12:28:15 PM1/6/13
to vim_use
Excerpts from niva's message of Sun Jan 06 18:19:58 +0100 2013:
> I think it automd that make startup of X Gvim session to slow but how can I know that ?


a) try clean
gvim -u NONE -U NONE -N "$@"

fast? => its your .vimrc or viml code

slow? Its vim fault


b) run vim, then use :gui command to start gui.

:gui slow -> vim's fault
:gui fast -> its vim startup

Vim has builtin profiling - not sure whether its that helpful in your
case though.

Marc Weber

David Fishburn

unread,
Jan 6, 2013, 12:38:02 PM1/6/13
to vim_use
...
a) try clean
  gvim -u NONE -U NONE -N "$@"

I would also add --no-plugins to that.

After you have performed your tests and determined it is not Vim, then most likely it is some of your plugins.

Move half into a different folder, reload.
Continue until you figure out which plugin might be responsible or of course just too many are loaded.

HTH,
David 

Gary Johnson

unread,
Jan 6, 2013, 1:32:31 PM1/6/13
to vim_use
On 2013-01-06, David Fishburn wrote:
> ...
>
> a) try clean
> gvim -u NONE -U NONE -N "$@"

The "-U NONE" is not necessary if "-u NONE" is being used.

> I would also add --no-plugins to that.

That's spelled "--noplugin", although "--noplugins" also seems to
work.

It's not clear to me what you meant by that. "-u NONE" already
inhibits the loading of plugins.

gvim --noplugin

will start gvim with the normal vimrc files but without loading
plugins. However, if your vimrc enables filetype plugins and/or
syntax highlighting and you open a file, any filetype-dependent
plugins will still be loaded.

Regards,
Gary

John Little

unread,
Jan 6, 2013, 5:59:02 PM1/6/13
to vim...@googlegroups.com
On Monday, January 7, 2013 6:19:58 AM UTC+13, niva wrote:

> by profiling ?

See
:help slow-start
:help --startuptime

Also, which version and OS, and configuration? There are some gotchas we could advise you on (such as the -X mentioned in slow-start).

Regards, John Little

niva

unread,
Jan 7, 2013, 5:35:04 AM1/7/13
to vim...@googlegroups.com
Le dimanche 6 janvier 2013 18:19:58 UTC+1, niva a écrit :
> Hi,I think it automd that make startup of X Gvim session to slow but how can I know that ? by profiling ?Thanks for your advises

I have checked that Gvim is faster without loading plugins and vimrc by this command :
gvim -u NONE -U NONE -N "$@"


So, now, i would like to call a function that is in one plugin.

Is it possible to load only one plugin and without _vimrc ?

Thanks you

Marc Weber

unread,
Jan 7, 2013, 6:15:56 AM1/7/13
to vim_use
Excerpts from niva's message of Mon Jan 07 11:35:04 +0100 2013:
> Is it possible to load only one plugin and without _vimrc ?
github.com/MarcWeber/vim-addon-manager

let's you choose which plugins to activate easily.
It also supports loading plugins at runtime as needed.

grep its documentation for filetype which will tell you how to activate
plugins if you edit a specific filetype only.

The interesting question is how to tell vim which plugin to load.
Env vars could be used:

V_P='my-plugin' vim # start vim passing V_P env var set to my-plugin
then read $V_P inside you .vimrc and load my-plugin this way.

Of course there are more solutions. This is my (biased) recommendation.
Marc Weber

lith

unread,
Jan 7, 2013, 7:33:01 AM1/7/13
to vim...@googlegroups.com
>> So, now, i would like to call a function that is in one plugin.
>> Is it possible to load only one plugin and without _vimrc ?
> let's you choose which plugins to activate easily.

Alternatively, you could use the tplugin script (http://www.vim.org/scripts/script.php?script_id=2917), which will define proxy commands & catch calls to undefined functions (similar to the AsNeeded plugin) in order to enable plugins only when they are needed. You have to run the :TPluginScan command first in order to enable tplugin. You can still use VAM or a similar plugin manager to download & update your plugins.

Reply all
Reply to author
Forward
0 new messages