From aaf5b15bae575dfcb7cb58853e405777815dfcf5 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 18 Mar 2022 06:27:38 -0500 Subject: [PATCH] refactor(nvim): Use nvim_create_autocmd api --- .config/nvim/lua/plugins/configs/dashboard-nvim.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/configs/dashboard-nvim.lua b/.config/nvim/lua/plugins/configs/dashboard-nvim.lua index f3e6776b..55b9ef31 100755 --- a/.config/nvim/lua/plugins/configs/dashboard-nvim.lua +++ b/.config/nvim/lua/plugins/configs/dashboard-nvim.lua @@ -27,5 +27,13 @@ g.dashboard_custom_footer = { } -- Disable statusline and cursorline in dashboard. -vim.cmd('autocmd BufEnter * if &ft is "dashboard" | set laststatus=0 | else | set laststatus=3 | endif') -vim.cmd('autocmd BufEnter * if &ft is "dashboard" | set nocursorline | endif') +vim.api.nvim_create_autocmd("BufEnter", { + callback = function () + if vim.bo.filetype == "dashboard" then + vim.opt.laststatus = 0 + vim.opt.nocursorline = true + else + vim.opt.laststatus = 3 + end + end +})