diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-23 22:09:13 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-23 22:09:13 +0200 |
commit | caf55dcabc2f4bce8f517a03ae56535920c7c4ce (patch) | |
tree | 57c7cc1864fdd17ab36277ca27cbdfd8da16f174 | |
parent | d474c779523c512e3bc91bc5ce7bc87cafc6372b (diff) |
Update autocmd for cursorline
-rw-r--r-- | fnl/settings/autocmds.fnl | 33 |
1 files changed, 19 insertions, 14 deletions
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)) |