startuptime.vim


Ⅰ. 插件描述

Breakdown Vim's --startuptime output

Ⅱ. 基本信息

创建日期:  2017-03-02
使用用户:  54
Github星:  128
插件作者:  Tommy Allen

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'tweekmonster/startuptime-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'tweekmonster/startuptime-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'tweekmonster/startuptime-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/tweekmonster/startuptime.vim

Ⅳ. 文档说明

# startuptime.vim

startuptime

Everybody knows that 1ms could mean the difference between life and death in
Vim. This plugin breaks down the output of --startuptime so you can zero in
on the scripts that are stealing dozens of your milliseconds each time Vim is

  1. You won't even need to leave the comfort of Vim.

Usage

Use the command :StartupTime to get an averaged startup profile. By default,
it collects 10 samples.

It accepts multiple arguments. If a number is found, it is used as the sample

  1. If a filename is found, it will be used with the -u argument while
    profiling.

Example collecting 100 samples and using ~/foo.vim as the vimrc script:

:StartupTime ~/foo.vim 100

If -- is found in the command arguments, everything after it will be used
verbatim in the program execution.

Example collecting 100 samples with manual arguments:

:StartupTime 100 -- -u ~/foo.vim -i NONE -- ~/foo.vim

Note that the first -- is dropped.

To upload the results, you can use a plugin like
gist-vim.

Details

You have been able to profile Vim's startup by using the --startuptime
argument since v7.2. However, the results are written to a file and it reports
timing per loaded script. The output method and results aren't very useful to
a layman that just wants to know what plugins are affecting Vim's startup
speed.

This plugin takes multiple samples (10 by default) of the --startuptime
output and displays the average times broken down by source. A source
could be your [vimrc] scripts, Vim's built-in [runtime] scripts, or

  1. Vim doesn't actually have a formal plugin system. As a result, a
    "plugin" is simply a path found in runtimepath that looks like a plugin.

If the source can't be determined, it display as [unknown].

The results shows the total average startup time and the 10 slowest "plugins".
Below it are the load times, separated by startup phases and sorted by load

  1. Under each phase, load times are broken down by "plugin". Under each
    "plugin" are the load times for individual scripts. These are folded by

default and can be opened with zo if you want more detail.

添加新评论