1
0
Fork 0
numbers/nvim/plugin/autocmds.vim

25 lines
752 B
VimL

scriptencoding utf-8
if !exists('autocommands_loaded') && has('autocmd')
let autocommands_loaded = 1
let ftToIgnore = ['markdown', 'html', 'text']
aug OnInsert
au InsertLeave * if &paste | setlocal nopaste | endif
au InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
aug END
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
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
endif