[[plugins]] repo = 'machakann/vim-sandwich' depends = [ 'vim-repeat', 'vim-textobj-entire', 'vim-textobj-line', 'vim-textobj-wiw', 'vim-textobj-anyblock', 'vim-textobj-between', 'vim-textobj-functioncall', ] hook_add = ''' runtime macros/sandwich/keymap/surround.vim let g:operator#sandwich#options = #{ add: #{ char: #{ skip_space: v:true } } } let g:sandwich#recipes = exists('g:sandwich#recipes') \ ? deepcopy(g:sandwich#recipes) : deepcopy(g:sandwich#default_recipes) " form https://github.com/yuki-yano/dotfiles/blob/8840dc3a90/.vimrc#L2899 let g:sandwich#recipes += [ \ { \ 'buns': ['${', '}'], \ 'input': ['$'], \ 'filetype': ['javascript', 'javascriptreact', 'typescript', 'typescriptreact'], \ }, \ { \ 'buns': ['#{', '}'], \ 'input': ['#'], \ 'filetype': ['vim', 'ruby', 'eruby'], \ }, \ { \ 'buns': ['InputGenerics()', '">"'], \ 'expr': v:true, \ 'cursor': 'inner_tail', \ 'kind': ['add', 'replace'], \ 'action': ['add'], \ 'input': ['g'], \ }, \ { \ 'external': ['i<', "\(textobj-functioncall-generics-a)"], \ 'noremap': v:false, \ 'kind': ['delete', 'replace', 'query'], \ 'input': ['g'], \ }, \ ] function! InputGenerics() abort let genericsname = input('Generics Name: ', '') if genericsname ==# '' throw 'OperatorSandwichCancel' endif return genericsname . '<' endfunction ''' # [[plugins]] # repo = 'tpope/vim-repeat' # on_map = { xno = '(Repeat' } [[plugins]] repo = 'kana/vim-operator-user' [[plugins]] repo = 'kana/vim-textobj-user' # [[plugins]] # repo = 'kana/vim-textobj-indent' # on_map = { xo = '' } # depends = ['vim-textobj-user'] [[plugins]] repo = 'kana/vim-textobj-entire' on_map = { xo = '' } depends = ['vim-textobj-user'] hook_add = ''' omap ae (textobj-entire-a) omap ie (textobj-entire-i) xmap ae (textobj-entire-a) xmap ie (textobj-entire-i) ''' [[plugins]] repo = 'kana/vim-textobj-line' on_map = { xo = '' } depends = ['vim-textobj-user'] hook_add = ''' omap al (textobj-line-a) omap il (textobj-line-i) xmap al (textobj-line-a) xmap il (textobj-line-i) ''' [[plugins]] repo = 'machakann/vim-textobj-functioncall' on_map = { xo = '' } on_func = ['textobj#functioncall#i', 'textobj#functioncall#ip'] depends = ['vim-textobj-user'] hook_add = ''' " from https://github.com/yuki-yano/dotfiles/blob/8840dc3a90/.vimrc#L2953 let g:textobj_functioncall_no_default_key_mappings = v:true let g:textobj_functioncall_patterns = [{ \ 'header' : '\<\%(\h\k*\.\)*\h\k*', \ 'bra' : '(', \ 'ket' : ')', \ 'footer' : '', \ }] omap af (textobj-functioncall-i) omap if (textobj-functioncall-innerparen-i) xmap af (textobj-functioncall-i) xmap if (textobj-functioncall-innerparen-i) let g:textobj_functioncall_generics_patterns = [{ \ 'header' : '\<\h\k*', \ 'bra' : '<', \ 'ket' : '>', \ 'footer' : '', \ }] onoremap (textobj-functioncall-generics-a) :call textobj#functioncall#i('o', g:textobj_functioncall_generics_patterns) onoremap (textobj-functioncall-generics-i) :call textobj#functioncall#ip('o', g:textobj_functioncall_generics_patterns) xnoremap (textobj-functioncall-generics-a) :call textobj#functioncall#i('x', g:textobj_functioncall_generics_patterns) xnoremap (textobj-functioncall-generics-i) :call textobj#functioncall#ip('x', g:textobj_functioncall_generics_patterns) omap ag (textobj-functioncall-generics-a) omap ig (textobj-functioncall-generics-i) xmap ag (textobj-functioncall-generics-a) xmap ig (textobj-functioncall-generics-i) ''' [[plugins]] repo = 'rhysd/vim-textobj-anyblock' on_map = { xo = '' } depends = ['vim-textobj-user'] hook_add = ''' omap ab (textobj-anyblock-a) omap ib (textobj-anyblock-i) xmap ab (textobj-anyblock-a) xmap ib (textobj-anyblock-i) ''' [[plugins]] repo = 'rhysd/vim-textobj-wiw' on_map = { xo = '' } depends = ['vim-textobj-user'] hook_add = ''' let g:textobj_wiw_no_default_key_mappings = v:true omap au (textobj-wiw-a) omap iu (textobj-wiw-i) xmap au (textobj-wiw-a) xmap iu (textobj-wiw-i) ''' [[plugins]] repo = 'thinca/vim-textobj-between' on_map = { xo = '' } depends = ['vim-textobj-user'] hook_add = ''' let g:textobj_between_no_default_key_mappings = v:true omap ao (textobj-between-a) omap io (textobj-between-i) xmap ao (textobj-between-a) xmap io (textobj-between-i) '''