summaryrefslogtreecommitdiff
path: root/fnl/settings
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-23 22:09:13 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-23 22:09:13 +0200
commitcaf55dcabc2f4bce8f517a03ae56535920c7c4ce (patch)
tree57c7cc1864fdd17ab36277ca27cbdfd8da16f174 /fnl/settings
parentd474c779523c512e3bc91bc5ce7bc87cafc6372b (diff)
Update autocmd for cursorline
Diffstat (limited to 'fnl/settings')
-rw-r--r--fnl/settings/autocmds.fnl33
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))