vim9script # Autocommands augroup auto_nohlsearch | au! set updatetime=2000 noremap (nohlsearch) nohlsearch noremap! (nohlsearch) execute('nohlsearch')[-1] au CursorHold * call feedkeys("\(nohlsearch)", 'm') au InsertEnter * call feedkeys("\(nohlsearch)", 'm') augroup END augroup general | au! au Filetype * setl formatoptions=qjlron # goto last known position of the buffer au BufReadPost * \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' | exe 'normal! g`"' | endif # create non-existent directory before buffer save au BufWritePre * \ if !isdirectory(expand("%:p:h")) | call mkdir(expand("%:p:h"), "p") | endif au VimLeavePre * :exe $'mksession! {g:vimdata}/sessions/LAST' augroup end