Edit Page
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 32: | Line 32: | ||
endif |
endif |
||
endfunction |
endfunction |
||
− | nnoremap di" :call JHStringObject('d','"','i') |
+ | nnoremap di" :call JHStringObject('d','"','i')<CR> |
− | nnoremap di' :call JHStringObject('d',"'",'i') |
+ | nnoremap di' :call JHStringObject('d',"'",'i')<CR> |
− | nnoremap da" :call JHStringObject('d','"','a') |
+ | nnoremap da" :call JHStringObject('d','"','a')<CR> |
− | nnoremap da' :call JHStringObject('d',"'",'a') |
+ | nnoremap da' :call JHStringObject('d',"'",'a')<CR> |
− | nnoremap ci" :call JHStringObject('c','"','i') |
+ | nnoremap ci" :call JHStringObject('c','"','i')<CR> |
− | nnoremap ci' :call JHStringObject('c',"'",'i') |
+ | nnoremap ci' :call JHStringObject('c',"'",'i')<CR> |
− | nnoremap ca" :call JHStringObject('c','"','a') |
+ | nnoremap ca" :call JHStringObject('c','"','a')<CR> |
− | nnoremap ca' :call JHStringObject('c',"'",'a') |
+ | nnoremap ca' :call JHStringObject('c',"'",'a')<CR> |
− | nnoremap yi" :call JHStringObject('y','"','i') |
+ | nnoremap yi" :call JHStringObject('y','"','i')<CR> |
− | nnoremap yi' :call JHStringObject('y',"'",'i') |
+ | nnoremap yi' :call JHStringObject('y',"'",'i')<CR> |
− | nnoremap ya" :call JHStringObject('y','"','a') |
+ | nnoremap ya" :call JHStringObject('y','"','a')<CR> |
− | nnoremap ya' :call JHStringObject('y',"'",'a') |
+ | nnoremap ya' :call JHStringObject('y',"'",'a')<CR> |
</pre> |
</pre> |
||
Line 61: | Line 61: | ||
execute c |
execute c |
||
endfunction |
endfunction |
||
− | omap a" :call StringObject('"','a') |
+ | omap a" :call StringObject('"','a')<cr> |
− | omap i" :call StringObject('"','i') |
+ | omap i" :call StringObject('"','i')<cr> |
− | omap a' :call StringObject("'",'a') |
+ | omap a' :call StringObject("'",'a')<cr> |
− | omap i' :call StringObject("'",'i') |
+ | omap i' :call StringObject("'",'i')<cr> |
</pre> |
</pre> |
||
Using this method allows you to use all the built-in Vim operators on StringObjects without defining four mappings for each operator. |
Using this method allows you to use all the built-in Vim operators on StringObjects without defining four mappings for each operator. |
||
− | To get equivalent visual mode mappings add |
+ | To get equivalent visual mode mappings add <esc> to the start: |
<pre> |
<pre> |
||
− | vmap a" |
+ | vmap a" <esc>:call StringObject('"','a')<cr> |
− | vmap i" |
+ | vmap i" <esc>:call StringObject('"','i')<cr> |
− | vmap a' |
+ | vmap a' <esc>:call StringObject("'",'a')<cr> |
− | vmap i' |
+ | vmap i' <esc>:call StringObject("'",'i')<cr> |
</pre> |
</pre> |
||