Coder Social home page Coder Social logo

vim-startuptime's Introduction

build

vim-startuptime

vim-startuptime is a plugin for viewing vim and nvim startup event timing information. The data is automatically obtained by launching (n)vim with the --startuptime argument. See :help startuptime-configuration for details on customization options.

Requirements

  • vim>=8.0.1453 or nvim>=0.3.1
    • The plugin may work on earlier versions, but has not been tested.
    • The plugin depends on compile-time features for vim (not applicable for nvim).
      • +startuptime is required.
      • +timers is recommended, to capture all startup events.
      • +terminal is required.

Installation

A package manager can be used to install vim-startuptime.

Examples
  • Vim8 packages:
    • git clone https://github.com/dstein64/vim-startuptime ~/.vim/pack/plugins/start/vim-startuptime
  • Vundle:
    • Add Plugin 'dstein64/vim-startuptime' to ~/.vimrc
    • :PluginInstall or $ vim +PluginInstall +qall
  • Pathogen:
    • git clone --depth=1 https://github.com/dstein64/vim-startuptime ~/.vim/bundle/vim-startuptime
  • vim-plug:
    • Add Plug 'dstein64/vim-startuptime' to ~/.vimrc
    • :PlugInstall or $ vim +PlugInstall +qall
  • dein.vim:
    • Add call dein#add('dstein64/vim-startuptime') to ~/.vimrc
    • :call dein#install()
  • NeoBundle:
    • Add NeoBundle 'dstein64/vim-startuptime' to ~/.vimrc
    • Re-open vim or execute :source ~/.vimrc

Usage

  • Launch vim-startuptime with :StartupTime.
  • Press K on events to get additional information.
  • Press gf on sourcing events to load the corresponding file in a new split.
  • The key sequences above can be customized (:help startuptime-configuration).
  • Times are in milliseconds.

Documentation

Documentation can be accessed with either:

:help vim-startuptime

or:

:StartupTime --help

The underlying markup is in startuptime.txt.

There is documentation on the following topics.

Topic :help {subject}
Arguments startuptime-arguments
Modifiers startuptime-modifiers
Vim Options startuptime-vim-options
Configuration startuptime-configuration
Color Customization startuptime-color-customization

License

The source code has an MIT License.

See LICENSE.

vim-startuptime's People

Contributors

dstein64 avatar mg979 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-startuptime's Issues

Not working in neovim 0.7.0

The :StartupTime command just opens a horizontal split with
# vim-startuptime Running: [0%]
nothing happens afterwards, it remains on 0%

First few lines from :version

NVIM v0.7.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Can't figure out how to debug this, any help would be appreciated, thanks!

python3.vim is reported by :Startuptime but not by --startuptime

I am using neovim on NixOS. When I execute :Startuptime the top of the buffer shows that python3.vim has been loaded:

       startup: 800.9
event                  time percent plot
packer_compiled.lua  333.30   41.62 ██████████████████████████
python3.vim          241.31   30.13 ██████████████████▉
filetype.vim          21.35    2.67 █▋
opening buffers       20.72    2.59 █▋
...

The details for this file are (the prefix is due to NixOS, that is just the provider file in the neovim package):

event: sourcing /nix/store/qyawd05zszdvcrgbvdhr2q4ay6ac4v9r-neovim-unwrapped-0.6.0/share/nvim/runtime/autoload/provider/python3.vim
start: 526.474
self: 240.351
self+sourced: 241.306
finish: 767.780

But I was sceptical if I use anything with python3 so I checked with filter python scriptnames and that returns nothing. Here is also a startup.log generated with nvim --startuptime startup.log +q for reference. It does not contain the string python anywhere.

Why does :StartupTime show this python3.vim file but --startuptime and :scriptnames don't?

API to extract total startup time

Hi, love this plugin! Just wanted to see if there was an API available for extracting the total startup time returned from the Profile UI. I want to just display this value when Neovim starts.

[Feature Request] Show average total time

While it's great to see the percent breakdown of each event, it would also be useful to display the (average, for multiple tries) total startup time at the top of the startuptime buffer.

setting variable g:startuptime_tries bigger than 1 results in an error frequtently

If we set the variable g:startuptime_tries to other values than 1, when I run command :StartupTime, I saw the following error almost all the time:

Error detected while processing function 15[1]..118_Profile[2]..startuptime#Main[9]..118_Consolidate:
line 9:
E605: Exception not caught: vim-startuptime: inconsistent tries

Sometimes, this command does succeed, but rarely.

  • Nvim version: NVIM v0.5.0-dev+1459-g384f9870f
  • OS: Linux CentOS 7.4
  • vim-startuptime version: Latest master

doesn't work in vim, works fine in neovim?

Hello,

this plugin worked for me previously, but now it doesn't anymore (latest git version).
In neovim it works fine, however in vim / gvim I just end up with this in a vsplit:

# vim-startuptime
Running: [100%]

Any ideas what might be wrong?
I'm on vim/gvim 8.2.3995 on debian testing/unstable.

Greetings,

jgb

Inconsistent results with `nvim --startuptime time.log`?

When I launch vim on certain files, it takes like 5 seconds for it to actually open and render everything and be responsive, however, when I use this startup plugin, it shows me results such as 427.2, which is .4 seconds...

(It's my linter btw)

if I use the built-in nvim --startuptime, it shows me more inclusive results

Is there a way to be even more inclusive in its profiling? (or maybe not timeout or something?)

run :StartupTime block nvim if folder have a file `s`

nvim 0.6 debian 11

reproduce

nvim -u test_vimrc
:StartupTime
:StartupTime
:StartupTime

work fine.

touch s
nvim -u test_vimrc
:StartupTime
:StartupTime
nvim block, need kill nvim

test_vimrc

let g:config_dir = '/tmp/vimtest'
let g:cache_dir = '/tmp/vimtest/.cache'

let s:plug_install_dir = g:config_dir . '/plugged'
let s:plug_manager_file = s:plug_install_dir . '/vim-plug/plug.vim'
let s:plug_manager_download =
      \ 'silent !git clone --depth 1 https://github.com/junegunn/vim-plug '
      \ . s:plug_install_dir . '/vim-plug'
if filereadable(expand(s:plug_manager_file)) == 0
    exec s:plug_manager_download
endif
exec 'source '. s:plug_install_dir . '/vim-plug/plug.vim'
call plug#begin(expand(s:plug_install_dir))
Plug 'dstein64/vim-startuptime'
call plug#end()
delc PlugUpgrade

filetype plugin indent on
syntax enable

autocmd VimEnter *
      \  if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
      \|   PlugUpdate --sync
      \| endif

Not working in neovim

The :StartupTime command just opens a vsplit with

# vim-startuptime
Running: [0%]

And then nothing happens.

My neovim version is 0.6.1. This could be a configuration issue from my side, as I'm lazy loading this plugin on command execution. But there isn't any log or error. So I'm not sure how to proceed to debug this.

Feature Request: Allow to open a preexisting log file

I have a preexisting file vim.log that I obtained with vim --startuptime vim.log xxxxx.txt

I would like to :StartupTime vim.log to get the visualization of that file.

Rationale: My vim sometimes is very slow to startup. Sometimes not always, and I have been able to reproduce with vim --startuptime vim.log xxx.txt but not with :StartupTime alone. Hence I would like to be able to open the vim.log file that I generated and analyze it.

Set filetype to allow easier mapping customization

Could you please add set filetype=startuptime or similar for the startuptime buffer? This would be useful e.g. for making a ftplugin to set up additional mappings for the startuptime results buffer (such as mapping q to quit the buffer, etc.)

Feature: Add a config option to display total in StartupTime report

I tend to look more for total time, and as of now I it is show in the message area at the bottom of the screen instead of being shown with the report. It would be nice to have a configuration option to show the sum on top row before any other time, something like this:

event                  time percent plot
------                ----- ------- ----
total                250.00  100.00 
.vimrc                41.55   21.01 ██████████████████████████

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.