diff options
| author | aktersnurra <gustaf@gustafrydholm.xyz> | 2026-04-16 15:10:52 +0200 |
|---|---|---|
| committer | aktersnurra <gustaf@gustafrydholm.xyz> | 2026-04-17 00:02:28 +0200 |
| commit | 99a7ff44cdf70d028ef6aab26224f26f69ee528d (patch) | |
| tree | 3bac13281fe000f0cc9a1823b6ccac856b0acf88 /fnl/settings/autocmds.fnl | |
| parent | 83a7f3505a441f1c152229d50a3d6011951a82fc (diff) | |
Diffstat (limited to 'fnl/settings/autocmds.fnl')
| -rw-r--r-- | fnl/settings/autocmds.fnl | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/fnl/settings/autocmds.fnl b/fnl/settings/autocmds.fnl index 9b5eac5..2f0a3cd 100644 --- a/fnl/settings/autocmds.fnl +++ b/fnl/settings/autocmds.fnl @@ -1,30 +1,30 @@ ;; Autocommands for nvim. -(local auto-cmds [[:FileType - {:pattern [:qf :help :man :lspinfo] - :command "nnoremap <silent> <buffer> q :close<CR>"}] - [:TextYankPost - {:callback (λ [] - (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] - {:pattern "*" - :callback (fn [] - (when (= (vim.fn.mode) :n) - (vim.cmd :checktime)))}] - [[:InsertLeave :WinEnter] - {:callback (λ [] - (let [cursorline (require :settings.cursorline)] - cursorline.show))}] - [[:InsertEnter :WinLeave] - {:callback (λ [] - (let [cursorline (require :settings.cursorline)] - cursorline.hide))}]]) +(import-macros {: autocmds} :macros) -(let [{: create-auto-cmds} (require :util.cmds)] - (create-auto-cmds auto-cmds)) +(autocmds + [:FileType + {:pattern [:qf :help :man :lspinfo] + :command "nnoremap <silent> <buffer> q :close<CR>"}] + [:TextYankPost + {:callback (λ [] + (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] + {:pattern "*" + :callback (fn [] + (when (= (vim.fn.mode) :n) + (vim.cmd :checktime)))}] + [[:InsertLeave :WinEnter] + {:callback (λ [] + (let [cursorline (require :settings.cursorline)] + cursorline.show))}] + [[:InsertEnter :WinLeave] + {:callback (λ [] + (let [cursorline (require :settings.cursorline)] + cursorline.hide))}]) |