From 2af2dd23500288f3bf1d30e94335975f73592dbc Mon Sep 17 00:00:00 2001 From: Akos Gyimesi Date: Thu, 23 Feb 2012 20:58:42 +0100 Subject: [PATCH] Add mapping for default MacVim movements --- plugin/delimitMate.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index 6eca52d..462feb5 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -364,6 +364,15 @@ function! s:ExtraMappings() "{{{ exec 'silent! imap <'.map.'> delimitMate'.map endif endfor + " Also for default MacVim movements: + if has('gui_macvim') + for [key, map] in [['D-Left','Home'], ['D-Right','End'], ['M-Left','C-Left'], ['M-Right','C-Right']] + exec 'inoremap delimitMate'.key.' =Finish()<'.map.'>' + if mapcheck('<'.key.'>', 'i') == '<'.map.'>' + exec 'silent! imap <'.key.'> delimitMate'.key + endif + endfor + endif " Except when pop-up menu is active: for map in ['Up', 'Down', 'PageUp', 'PageDown', 'S-Down', 'S-Up'] exec 'inoremap delimitMate'.map.' pumvisible() ? "\<'.map.'>" : "\=\Finish()\\<'.map.'>"'