Putting autocomands in a group (#59)

* Warp autocmd with augroup
This commit is contained in:
Shadman 2021-01-11 08:40:09 +06:00 committed by GitHub
parent 8742b6e466
commit 2c1888e947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -109,9 +109,12 @@ end
local function exec_autocommands() local function exec_autocommands()
_G.set_lualine_theme = set_lualine_theme _G.set_lualine_theme = set_lualine_theme
_G.set_active_statusline = statusline _G.set_active_statusline = statusline
vim.cmd([[augroup lualine]])
vim.cmd([[autocmd!]])
vim.cmd([[autocmd WinEnter,BufEnter * setlocal statusline=%!v:lua.set_active_statusline(1)]]) vim.cmd([[autocmd WinEnter,BufEnter * setlocal statusline=%!v:lua.set_active_statusline(1)]])
vim.cmd([[autocmd WinLeave,BufLeave * lua require('lualine').set_inactive_statusline()]]) vim.cmd([[autocmd WinLeave,BufLeave * lua require('lualine').set_inactive_statusline()]])
vim.cmd([[autocmd ColorScheme * call v:lua.set_lualine_theme()]]) vim.cmd([[autocmd ColorScheme * call v:lua.set_lualine_theme()]])
vim.cmd([[augroup END]])
end end
function M.status() function M.status()