diff options
Diffstat (limited to 'ftplugin/mustache.vim')
-rw-r--r-- | ftplugin/mustache.vim | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ftplugin/mustache.vim b/ftplugin/mustache.vim index 38901654..592ed09d 100644 --- a/ftplugin/mustache.vim +++ b/ftplugin/mustache.vim @@ -59,10 +59,18 @@ xnoremap <silent> <buffer> ]] :<C-U>call <SID>sectionmovement('{{','' ,'v',v:cou " Operator pending mappings -onoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR> -onoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR> -xnoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR> -xnoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR> +" Operators are available by default. Set `let g:mustache_operators = 0` in +" your .vimrc to disable them. +if ! exists("g:mustache_operators") + let g:mustache_operators = 1 +endif + +if exists("g:mustache_operators") && g:mustache_operators + onoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR> + onoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR> + xnoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR> + xnoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR> +endif function! s:wrap_around() " If the cursor is at the end of the tag element, move back |