Closed bb010g closed 4 years ago
I don't know why the feature is really needed. Please explain it more clearly.
Why do you use a deinft.toml
file, instead of otherwise attaching the filetype initializations to plugins in dein.toml
or deinlazy.toml
, or handling it all detached from dein in VimScript (e.g. a ftplugin.rc.vim
)?
I'm just wanting the same functionality, but divorced from the slower cost of TOML parsing.
Why do you use a deinft.toml file, instead of otherwise attaching the filetype initializations to plugins in dein.toml or deinlazy.toml, or handling it all detached from dein in VimScript (e.g. a ftplugin.rc.vim)?
Because, I want to split global configuration from plugin configuration. And using toml is better for me.
I'm just wanting the same functionality, but divorced from the slower cost of TOML parsing.
TOML parsing cost is not high because if you use dein#save_state()/dein#load_state()
, it is not parsed everytime.
I can expose g:dein#ftplugin
for Vim script users.
But I don't think it is useful.
User must write ftplugin configuration by string. It is not easy to write than toml.
For example:
let g:ftplugin = {
'vim': "echomsg 'hoge'"
}
If you have better interface, please explain it for me.
No response? If so, I will close it.
Problems summary
TOML configuration (via
dein#load_toml()
) supports top-levelftplugin
configuration, directly callingdein.vim/autoload/dein/parse.vim
'ss:merge_ftplugin()
:https://github.com/Shougo/dein.vim/blob/9d78da821434d7bd794c956b60d7e1e314ebd61c/autoload/dein/parse.vim#L174-L176
The only other place this
s:merge_ftplugin()
is exposed is normal plugin configuration, viadein#parse#_add()
, requiring a chaperoning plugin:https://github.com/Shougo/dein.vim/blob/9d78da821434d7bd794c956b60d7e1e314ebd61c/autoload/dein/parse.vim#L35-L37
Expected
I can call a public function from VimScript that acts equivalently to a top-level
ftplugin
table under the TOML syntax.Currently, you can bodge by copying out
s:merge_ftplugin()
and mutatingg:dein#_ftplugin
in the same way, but that's relying on dein's private internals.