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

Change autocomands for lua #41

Open
voyeg3r opened this issue Nov 5, 2022 · 0 comments
Open

Change autocomands for lua #41

voyeg3r opened this issue Nov 5, 2022 · 0 comments

Comments

@voyeg3r
Copy link

voyeg3r commented Nov 5, 2022

https://github.com/sunjon/Shade.nvim/blob/master/lua/shade.lua#L259

I think nvim already has autocomands, no need to keep old vimscript calls:

  -- setup autocommands -- TODO: set a precalculated winid
  api.nvim_exec([[
    augroup shade
    au!
    au WinEnter,VimEnter * call v:lua.require'shade'.autocmd('WinEnter',  win_getid())
    au WinClosed         * call v:lua.require'shade'.autocmd('WinClosed', expand('<afile>'))
    au TabEnter          * call v:lua.require'shade'.autocmd('TabEnter',  win_getid())
    au OptionSet         diff call v:lua.require'shade'.autocmd('OptionSet', win_getid())
    augroup END
  ]], false)
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

1 participant