nvim: move out cornelis autocommands to avoid duplication

This commit is contained in:
Primrose 2026-01-25 11:49:00 +01:00
parent e63978da7f
commit 16dfce7e6e
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 18 additions and 20 deletions

View file

@ -150,26 +150,7 @@ imap <buffer> \Chi Χ
imap <buffer> \Psi Ψ
imap <buffer> \Omega Ω
" autoload
function! CornelisLoadWrapper()
if exists(":CornelisLoad") ==# 2
CornelisLoad
endif
endfunction
au BufReadPre *.agda call CornelisLoadWrapper()
au BufReadPre *.lagda* call CornelisLoadWrapper()
au BufRead,BufNewFile *.agda call AgdaFiletype()
au BufRead,BufNewFile *.lagda* call AgdaFiletype()
au QuitPre *.agda :CornelisCloseInfoWindows
au QuitPre *.lagda* :CornelisCloseInfoWindows
" autoreload at file write
au BufWritePost *.agda execute "normal! :CornelisLoad\<CR>"
au BufWritePost *.lagda* execute "normal! :CornelisLoad\<CR>"
" default cornelis config
" default cornelis mapping
nnoremap <buffer> <leader>l :CornelisLoad<CR>
nnoremap <buffer> <leader>r :CornelisRefine<CR>
nnoremap <buffer> <leader>d :CornelisMakeCase<CR>

View file

@ -0,0 +1,17 @@
" agda related autocommands
function! CornelisLoadWrapper()
if exists(":CornelisLoad") ==# 2
CornelisLoad
endif
endfunction
au BufReadPre *.agda call CornelisLoadWrapper()
au BufReadPre *.lagda* call CornelisLoadWrapper()
au QuitPre *.agda :CornelisCloseInfoWindows
au QuitPre *.lagda* :CornelisCloseInfoWindows
" autoreload at file write
au BufWritePost *.agda execute "normal! :CornelisLoad\<CR>"
au BufWritePost *.lagda* execute "normal! :CornelisLoad\<CR>"