mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:39:39 +00:00
nvim: move out cornelis autocommands to avoid duplication
This commit is contained in:
parent
e63978da7f
commit
16dfce7e6e
2 changed files with 18 additions and 20 deletions
|
|
@ -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>
|
||||
|
|
|
|||
17
.config/nvim/plugin/cornelis.vim
Normal file
17
.config/nvim/plugin/cornelis.vim
Normal 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>"
|
||||
Loading…
Add table
Add a link
Reference in a new issue