From 54c434f56570cc536f3de742ad2a8b32cee852bf Mon Sep 17 00:00:00 2001 From: aiya000 Date: Wed, 7 Feb 2018 14:48:02 +0900 Subject: [PATCH 1/2] Create plugin/idris.vim --- plugin/idris.vim | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugin/idris.vim diff --git a/plugin/idris.vim b/plugin/idris.vim new file mode 100644 index 0000000..8f936b5 --- /dev/null +++ b/plugin/idris.vim @@ -0,0 +1,6 @@ +scriptencoding utf-8 + +if exists('g:loaded_idris_vim') + finish +endif +let g:loaded_idris_vim = 1 From d76e7157d6c6f70d159b56922cf3387c68bc2649 Mon Sep 17 00:00:00 2001 From: aiya000 Date: Wed, 7 Feb 2018 14:52:07 +0900 Subject: [PATCH 2/2] Add g:idris_vim_enable_keymappings_by_default --- ftplugin/idris.vim | 34 ++++++++++++++++++---------------- plugin/idris.vim | 2 ++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ftplugin/idris.vim b/ftplugin/idris.vim index 9b0a032..fa04eec 100644 --- a/ftplugin/idris.vim +++ b/ftplugin/idris.vim @@ -310,22 +310,24 @@ function! IdrisEval() endif endfunction -nnoremap t :call IdrisShowType() -nnoremap r :call IdrisReload(0) -nnoremap c :call IdrisCaseSplit() -nnoremap d 0:call search(":")b:call IdrisAddClause(0)w -nnoremap b 0:call IdrisAddClause(0) -nnoremap m :call IdrisAddMissing() -nnoremap md 0:call search(":")b:call IdrisAddClause(1)w -nnoremap f :call IdrisRefine() -nnoremap o :call IdrisProofSearch(0) -nnoremap p :call IdrisProofSearch(1) -nnoremap l :call IdrisMakeLemma() -nnoremap e :call IdrisEval() -nnoremap w 0:call IdrisMakeWith() -nnoremap mc :call IdrisMakeCase() -nnoremap i 0:call IdrisResponseWin() -nnoremap h :call IdrisShowDoc() +if g:idris_vim_enable_keymappings_by_default + nnoremap t :call IdrisShowType() + nnoremap r :call IdrisReload(0) + nnoremap c :call IdrisCaseSplit() + nnoremap d 0:call search(":")b:call IdrisAddClause(0)w + nnoremap b 0:call IdrisAddClause(0) + nnoremap m :call IdrisAddMissing() + nnoremap md 0:call search(":")b:call IdrisAddClause(1)w + nnoremap f :call IdrisRefine() + nnoremap o :call IdrisProofSearch(0) + nnoremap p :call IdrisProofSearch(1) + nnoremap l :call IdrisMakeLemma() + nnoremap e :call IdrisEval() + nnoremap w 0:call IdrisMakeWith() + nnoremap mc :call IdrisMakeCase() + nnoremap i 0:call IdrisResponseWin() + nnoremap h :call IdrisShowDoc() +endif menu Idris.Reload r menu Idris.Show\ Type t diff --git a/plugin/idris.vim b/plugin/idris.vim index 8f936b5..7ce0880 100644 --- a/plugin/idris.vim +++ b/plugin/idris.vim @@ -4,3 +4,5 @@ if exists('g:loaded_idris_vim') finish endif let g:loaded_idris_vim = 1 + +let g:idris_vim_enable_keymappings_by_default = get(g:, 'idris_vim_enable_keymappings_by_default', 1)