diff options
Diffstat (limited to 'lua/cursorline.lua')
-rw-r--r-- | lua/cursorline.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lua/cursorline.lua b/lua/cursorline.lua new file mode 100644 index 0000000..3a486d3 --- /dev/null +++ b/lua/cursorline.lua @@ -0,0 +1,20 @@ +local autocmd = vim.api.nvim_create_autocmd + +local set_cursorline = function() + local buf = vim.api.nvim_get_current_buf() + + -- Do not set cursorline if telescope is open. + if vim.bo[buf].filetype == "TelescopePrompt" then + vim.cmd("set nocul") + else + vim.cmd("set cul") + end +end + +autocmd("InsertEnter", +{pattern="*", callback=set_cursorline +}) + +autocmd("InsertLeave", +{pattern="*", command="set nocul" +}) |