" ============================================================================== " File: expand_region.vim " Author: Terry Ma " Description: Incrementally select larger regions of text in visual mode by " repeating the same key combination " Last Modified: March 30, 2013 " ============================================================================== let s:save_cpo = &cpo set cpo&vim " Init global vars call expand_region#init() " ============================================================================== " Mappings " ============================================================================== if !hasmapto('(expand_region_expand)') nmap + (expand_region_expand) vmap + (expand_region_expand) endif if !hasmapto('(expand_region_shrink)') vmap _ (expand_region_shrink) nmap _ (expand_region_shrink) endif nnoremap (expand_region_expand) \ :call expand_region#next('n', '+') " Map keys differently depending on which mode is desired if expand_region#use_select_mode() snoremap (expand_region_expand) \ :call expand_region#next('v', '+') snoremap (expand_region_shrink) \ :call expand_region#next('v', '-') else xnoremap (expand_region_expand) \ :call expand_region#next('v', '+') xnoremap (expand_region_shrink) \ :call expand_region#next('v', '-') endif let &cpo = s:save_cpo unlet s:save_cpo