From caf55dcabc2f4bce8f517a03ae56535920c7c4ce Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 23 Sep 2023 22:09:13 +0200 Subject: Update autocmd for cursorline --- fnl/settings/autocmds.fnl | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'fnl/settings') diff --git a/fnl/settings/autocmds.fnl b/fnl/settings/autocmds.fnl index 5a2a145..b078718 100644 --- a/fnl/settings/autocmds.fnl +++ b/fnl/settings/autocmds.fnl @@ -1,19 +1,24 @@ ;; Autocommands for nvim. -(local cursorline (require :util.cursorline)) - -(local auto-cmds - [[:TextYankPost - {:callback (lambda [] - (vim.highlight.on_yank {:higroup :Visual :timeout 200}))}] - [:BufWinEnter {:command "setlocal formatoptions-=cro"}] - [:FileType {:pattern :qf :command "set nobuflisted"}] - [:FileType {:pattern [:gitcommit :markdown] :command "setlocal wrap"}] - [:VimResized {:command "tabdo wincmd ="}] - [[:FocusGained :BufEnter :CursorHold :CursorHoldI] - {:command :checktime}] - [[:InsertLeave :WinEnter] {:callback cursorline.show}] - [[:InsertEnter :WinLeave] {:callback cursorline.hide}]]) +(local auto-cmds [[:TextYankPost + {:callback (lambda [] + (vim.highlight.on_yank {:higroup :Visual + :timeout 200}))}] + [:BufWinEnter {:command "setlocal formatoptions-=cro"}] + [:FileType {:pattern :qf :command "set nobuflisted"}] + [:FileType + {:pattern [:gitcommit :markdown] :command "setlocal wrap"}] + [:VimResized {:command "tabdo wincmd ="}] + [[:FocusGained :BufEnter :CursorHold :CursorHoldI] + {:command :checktime}] + [[:InsertLeave :WinEnter] + {:callback (lambda [] + (let [cursorline (require :util.cursorline)] + cursorline.show))}] + [[:InsertEnter :WinLeave] + {:callback (lambda [] + (let [cursorline (require :util.cursorline)] + cursorline.hide))}]]) (let [cmds (require :util.cmds)] (cmds.create-auto-cmds auto-cmds)) -- cgit v1.2.3-70-g09d2