galaxyline.nvim
galaxyline.nvim copied to clipboard
consider move initialization to lua
I like the plugin very much. Thanks alot for creating!
Reasons to do:
- A pure lua profile would decrease startup time.
- The lua startup profiler would be more correct or simpler to get correct with this change. Otherwise one gets more wrong results.
- Try to be consistent as to use functionality of lua, if possible.
- Having a function to initialize makes separating things for user-specific settings while getting updates much easier (user may implement a different function to customize plugin).
Another related reason (bad practice/historical reasons): nvim-treesitter/module-template#1
Relevant content for change: https://github.com/nanotee/nvim-lua-guide#using-meta-accessors-1
missing fixes: https://github.com/nanotee/nvim-lua-guide/#managing-vim-internal-variables and the echo stuff
if vim.g.loaded_galaxyline == nil
--let s:save_cpo = &cpo --is there any way to make this plugin local?
--set cpo&vim --is there any way to make this plugin local?
if vim.fn.has('nvim') == 0 then
--echohl Error
--echom "Sorry this plugin only works with versions of neovim that support lua"
--echohl clear
--finish
end
vim.g.loaded_galaxyline = 1
require('galaxyline').galaxyline_augroup()
--let &cpo = s:save_cpo --is there any way to make this plugin local?
--unlet s:save_cpo --is there any way to make this plugin local?
end
hmm this will need user to call it by themself.
@glepnir Can you elaborate how this would be a problem? I wanted to discuss first before creating a PR.