Thursday, October 26, 2017

Re: Vim startup profiling

Hi,

2017/10/25 Wed 21:28:50 UTC+9 Christian Brabandt wrote:
> Hi Ken,
> I briefly looked at your patch and have some feedback.
>
> On Mi, 25 Okt 2017, Ken Takata wrote:
>
> > Changes are:
> > * Merge the two patches into one.
> > * Update the document.
> > * Rename the global variable `do_globpath_menus` to `do_lazyload_menus`.
> > I'm still wondering what is the best name for this variable.
> > * Remove `has('win16')`. Not needed anymore.
> > * Add <silent> to the "Show File Types in Menu" item. Showing the command
> > of this item is not so useful.
>
> +If you want to have all these items already present at startup, add: >
> + :let do_lazyload_menus = 1
>
> I think this variable should either be called `do_no_lazyload_menus` or
> the value should be 0, since by default the menus will be lazy loaded.

Okay, I changed it to `do_no_lazyload_menus`:
https://bitbucket.org/k_takata/vim-ktakata-mq/src/cda66cbfc90b98a5ca6c16229ee129fd448c1bad/improve-loading-menu.vim.patch?fileviewer=file-view-default

Actually, menu.vim only checks the existence of the global variable, the value
is not checked. This is the same as other variable in menu.vim.


> + let n = globpath(&runtimepath, "colors/*.vim")
>
> I think that should be
>
> + let n = globpath(&runtimepath, "colors/*.vim", 1, 1)
>
> So you have a list available already and don't need to split later on
> manually and you probably do want to ignore the suffixes and wildignore
> options, if only the user having set them to bad values.
>
> The same holds for the keymap and compiler runtime files.

It makes the code simpler. Updated.


> + augroup SetupLazyloadMenus
> + au!
> + au CursorHold,CursorHoldI * call <SID>SetupLazyloadMenus() | au! SetupLazyloadMenus
> + augroup END
>
> Is this actually a good idea to delete the augroup from within itself?

Deleting autocommands in the group is a usual usage. The similar usage can be
found in `augroup LoadBufferMenu` in menu.vim. Moreover, just using `au!`
in an augroup is a normal usage. Deleting an autogroup within itself by
`augroup!` doesn't work in contrast. It causes W19 or E936.
Actually, I want to delete the group here...


> BTW: there are many runtime file variables. Perhaps we should start to
> document internal runtime file variables in a help file at a central
> place.
>
> Also I am starting to wonder, whether it would make sense to start using
> a common prefix, so that the names are more consistent and less likely
> to clash with user variables, e.g. something like
> vim_ftplugin_undo
> vim_indent_undo
> vim_menu_init_immediate

Regards,
Ken Takata

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: