Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider move initialization to lua #134

Open
matu3ba opened this issue Apr 8, 2021 · 2 comments
Open

consider move initialization to lua #134

matu3ba opened this issue Apr 8, 2021 · 2 comments

Comments

@matu3ba
Copy link

matu3ba commented Apr 8, 2021

I like the plugin very much. Thanks alot for creating!

Reasons to do:

  1. A pure lua profile would decrease startup time.
  2. The lua startup profiler would be more correct or simpler to get correct with this change. Otherwise one gets more wrong results.
  3. Try to be consistent as to use functionality of lua, if possible.
  4. 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
@glepnir
Copy link
Member

glepnir commented Apr 9, 2021

hmm this will need user to call it by themself.

@matu3ba
Copy link
Author

matu3ba commented Apr 11, 2021

@glepnir Can you elaborate how this would be a problem? I wanted to discuss first before creating a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants