" The vim operator plugin to do well with 'sandwich' like structure " Last Change: 31-Oct-2021. " Maintainer : Masaaki Nakamura " License : NYSL " Japanese " English (Unofficial) if &compatible || exists("g:loaded_operator_sandwich") finish endif let g:loaded_operator_sandwich = 1 " keymappings nmap (operator-sandwich-add) (operator-sandwich-add-pre)(operator-sandwich-g@) xmap (operator-sandwich-add) (operator-sandwich-add-pre)(operator-sandwich-gv)(operator-sandwich-g@) omap (operator-sandwich-add) (operator-sandwich-g@) nmap (operator-sandwich-delete) (operator-sandwich-delete-pre)(operator-sandwich-g@) xmap (operator-sandwich-delete) (operator-sandwich-delete-pre)(operator-sandwich-gv)(operator-sandwich-g@) omap (operator-sandwich-delete) (operator-sandwich-g@) nmap (operator-sandwich-replace) (operator-sandwich-replace-pre)(operator-sandwich-g@) xmap (operator-sandwich-replace) (operator-sandwich-replace-pre)(operator-sandwich-gv)(operator-sandwich-g@) omap (operator-sandwich-replace) (operator-sandwich-g@) nnoremap (operator-sandwich-add-pre) :call operator#sandwich#prerequisite('add', 'n') xnoremap (operator-sandwich-add-pre) :call operator#sandwich#prerequisite('add', 'x') nnoremap (operator-sandwich-delete-pre) :call operator#sandwich#prerequisite('delete', 'n') xnoremap (operator-sandwich-delete-pre) :call operator#sandwich#prerequisite('delete', 'x') nnoremap (operator-sandwich-replace-pre) :call operator#sandwich#prerequisite('replace', 'n') xnoremap (operator-sandwich-replace-pre) :call operator#sandwich#prerequisite('replace', 'x') nnoremap (operator-sandwich-add-query1st) :call operator#sandwich#query1st('add', 'n') xnoremap (operator-sandwich-add-query1st) :call operator#sandwich#query1st('add', 'x') nnoremap (operator-sandwich-replace-query1st) :call operator#sandwich#query1st('replace', 'n') xnoremap (operator-sandwich-replace-query1st) :call operator#sandwich#query1st('replace', 'x') " supplementary keymappings onoremap (operator-sandwich-synchro-count) operator#sandwich#synchro_count() onoremap (operator-sandwich-release-count) operator#sandwich#release_count() onoremap (operator-sandwich-squash-count) operator#sandwich#squash_count() nnoremap (operator-sandwich-predot) operator#sandwich#predot() nnoremap (operator-sandwich-dot) operator#sandwich#dot() " visualrepeat.vim (vimscript #3848) support noremap (operator-sandwich-add-visualrepeat) :call operator#sandwich#visualrepeat('add') noremap (operator-sandwich-delete-visualrepeat) :call operator#sandwich#visualrepeat('delete') noremap (operator-sandwich-replace-visualrepeat) :call operator#sandwich#visualrepeat('replace') " intrinsic keymappings noremap (operator-sandwich-g@) g@ inoremap (operator-sandwich-g@) g@ nnoremap (operator-sandwich-gv) gv inoremap (operator-sandwich-gv) gv " use of vim-event-DotCommandPre if !hasmapto('(operator-sandwich-predot)') && !hasmapto('(operator-sandwich-dot)') && (hasmapto('(event-DotCommandPre)') || hasmapto('(event-DotCommandPre+Dot)')) augroup sandwich-predot autocmd User DotCommandPre call operator#sandwich#predot() augroup END endif