" snipMate maps " These maps are created here in order to make sure we can reliably create maps " after SuperTab. let s:save_cpo = &cpo set cpo&vim function! s:map_if_not_mapped(lhs, rhs, mode) let l:unique = s:overwrite ? '' : ' ' if !hasmapto(a:rhs, a:mode) silent! exe a:mode . 'map' . l:unique a:lhs a:rhs endif endfunction if !exists('g:snips_no_mappings') || !g:snips_no_mappings if exists('g:snips_trigger_key') echom 'g:snips_trigger_key is deprecated. See :h snipMate-mappings' exec 'imap ' g:snips_trigger_key 'snipMateTrigger' exec 'smap ' g:snips_trigger_key 'snipMateSNext' exec 'xmap ' g:snips_trigger_key 'snipMateVisual' else " Remove SuperTab map if it exists let s:overwrite = maparg('', 'i') ==? 'SuperTabForward' call s:map_if_not_mapped('', 'snipMateNextOrTrigger', 'i') call s:map_if_not_mapped('', 'snipMateNextOrTrigger', 's') let s:overwrite = 0 call s:map_if_not_mapped('', 'snipMateVisual', 'x') endif if exists('g:snips_trigger_key_backwards') echom 'g:snips_trigger_key_backwards is deprecated. See :h snipMate-mappings' exec 'imap ' g:snips_trigger_key_backwards 'snipMateIBack' exec 'smap ' g:snips_trigger_key_backwards 'snipMateSBack' else let s:overwrite = maparg('', 'i') ==? 'SuperTabBackward' call s:map_if_not_mapped('', 'snipMateBack', 'i') call s:map_if_not_mapped('', 'snipMateBack', 's') let s:overwrite = 0 endif call s:map_if_not_mapped('', 'snipMateShow', 'i') endif " FIXME: Without this map, in select mode deletes the current selection and " returns to normal mode. This doesn't update placeholders. Ideally there's some " way to update the placeholders without this otherwise useless map. silent! snoremap b let &cpo = s:save_cpo " vim:noet: