summaryrefslogtreecommitdiff
path: root/fnl/config/autocmd.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-06 15:33:54 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-06 15:33:54 +0200
commit9dd308b444ede3a68a29961e956937d2ce402e45 (patch)
treefb3781a48eedf1259eaebe8b417c4d3e4f2831b8 /fnl/config/autocmd.fnl
parent3400a46f370a6d1e80f8256eefe2ecce277e055f (diff)
Move autocmd fn back and rename
Diffstat (limited to 'fnl/config/autocmd.fnl')
-rw-r--r--fnl/config/autocmd.fnl41
1 files changed, 22 insertions, 19 deletions
diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl
index 28ed98d..40eb338 100644
--- a/fnl/config/autocmd.fnl
+++ b/fnl/config/autocmd.fnl
@@ -1,30 +1,33 @@
;; Autocommands for nvim.
(module config.autocmd {autoload {nvim aniseed.nvim a aniseed.core : util}})
-(util.autocmd :BufEnter
- {:command "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif"})
+(defn create-autocmd [event opts] (nvim.create_autocmd event opts))
-(util.autocmd :FileType
- {:pattern [:qf :help :man :lspinfo]
- :command "nnoremap <silent> <buffer> q :close<CR>"})
+(create-autocmd :BufEnter
+ {:command "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif"})
-(util.autocmd :TextYankPost
- {:callback (lambda []
- (vim.highlight.on_yank {:timeout 200}))})
+(create-autocmd :FileType
+ {:pattern [:qf :help :man :lspinfo]
+ :command "nnoremap <silent> <buffer> q :close<CR>"})
-(util.autocmd :BufWinEnter {:command "setlocal formatoptions-=cro"})
+(create-autocmd :TextYankPost
+ {:callback (lambda []
+ (vim.highlight.on_yank {:timeout 200}))})
-(util.autocmd :FileType {:pattern :qf :command "set nobuflisted"})
+(create-autocmd :BufWinEnter {:command "setlocal formatoptions-=cro"})
-(util.autocmd :FileType
- {:pattern :lir
- :callback (fn []
- (tset vim.opt_local :number false)
- (tset vim.opt_local :relativenumber false))})
+(create-autocmd :FileType {:pattern :qf :command "set nobuflisted"})
-(util.autocmd :FileType {:pattern [:gitcommit :markdown] :command "setlocal wrap"})
+(create-autocmd :FileType {:pattern :lir
+ :callback (fn []
+ (tset vim.opt_local :number false)
+ (tset vim.opt_local :relativenumber
+ false))})
-(util.autocmd :FileType {:pattern [:gitcommit :markdown :org :plaintex]
- :command "setlocal spell"})
+(create-autocmd :FileType {:pattern [:gitcommit :markdown]
+ :command "setlocal wrap"})
-(util.autocmd :VimResized {:command "tabdo wincmd ="})
+(create-autocmd :FileType {:pattern [:gitcommit :markdown :org :plaintex]
+ :command "setlocal spell"})
+
+(create-autocmd :VimResized {:command "tabdo wincmd ="})