diff options
Diffstat (limited to 'fnl')
-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)) |