summaryrefslogtreecommitdiffstats
path: root/ftplugin/mustache.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-06-08 13:18:33 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2014-06-08 13:18:33 +0200
commit45273d44d4b1bd9a1be431c1a98f9046ed3a5c79 (patch)
tree7b8fa566b3da949b422804c3bb9eaf9c51b9b69e /ftplugin/mustache.vim
parente961fa80374369c9e299b333639db0dc43d1f126 (diff)
downloadvim-polyglot-45273d44d4b1bd9a1be431c1a98f9046ed3a5c79.tar.gz
vim-polyglot-45273d44d4b1bd9a1be431c1a98f9046ed3a5c79.zip
Major update
Diffstat (limited to 'ftplugin/mustache.vim')
-rw-r--r--ftplugin/mustache.vim16
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