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.'>"'