From 10a6087a74b235a7e3a77310a21a563afad3a148 Mon Sep 17 00:00:00 2001 From: Shadman Date: Fri, 15 Jan 2021 10:15:04 +0600 Subject: [PATCH] run vimscript inside vim.api.nvim_exec (#73) --- lua/lualine.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lua/lualine.lua b/lua/lualine.lua index 89be952..3c13c79 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -109,12 +109,14 @@ end local function exec_autocommands() _G.set_lualine_theme = set_lualine_theme _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 WinLeave,BufLeave * lua require('lualine').set_inactive_statusline()]]) - vim.cmd([[autocmd ColorScheme * call v:lua.set_lualine_theme()]]) - vim.cmd([[augroup END]]) + vim.api.nvim_exec([[ + augroup lualine + autocmd! + autocmd WinEnter,BufEnter * setlocal statusline=%!v:lua.set_active_statusline(1) + autocmd WinLeave,BufLeave * lua require('lualine').set_inactive_statusline() + autocmd ColorScheme * call v:lua.set_lualine_theme() + augroup END + ]], false) end function M.status()