2021-04-16 00:15:31 +00:00
|
|
|
scriptencoding utf-8
|
|
|
|
|
|
|
|
if !exists('autocommands_loaded') && has('autocmd')
|
2021-10-19 23:00:23 +00:00
|
|
|
let autocommands_loaded = 1
|
|
|
|
let ftToIgnore = ['markdown', 'html', 'text']
|
2021-04-16 00:15:31 +00:00
|
|
|
|
2021-10-19 23:00:23 +00:00
|
|
|
aug OnInsert
|
|
|
|
au InsertLeave * if &paste | setlocal nopaste | endif
|
|
|
|
au InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
|
|
|
|
aug END
|
2021-04-16 00:15:31 +00:00
|
|
|
|
2021-10-19 23:00:23 +00:00
|
|
|
aug Miscs
|
|
|
|
au TextYankPost * silent! lua vim.highlight.on_yank{timeout = 80, on_visual=true}
|
|
|
|
au FileType TelescopePrompt lua require('cmp').setup.buffer { enabled = false }
|
|
|
|
au BufEnter * set fo-=c fo-=r fo-=o
|
|
|
|
aug END
|
2021-04-16 00:15:31 +00:00
|
|
|
|
2021-10-19 23:00:23 +00:00
|
|
|
aug OnSave
|
|
|
|
au BufWritePre * if index(ftToIgnore, &ft) < 0 | :%s/\s\+$//e
|
|
|
|
au BufWritePost *xresources !xrdb %
|
|
|
|
au BufWritePost *sxhkdrc !pkill -USR1 sxhkd
|
|
|
|
au QuitPre * if empty(&buftype) | lclose | endif
|
|
|
|
aug END
|
2021-04-16 00:15:31 +00:00
|
|
|
endif
|