Add note about I%/A% re. #16

This commit is contained in:
Andy K. Massimino
2018-03-03 12:59:36 -05:00
parent 61dcf75ca1
commit 660cb1a271
2 changed files with 37 additions and 0 deletions

View File

@@ -566,6 +566,25 @@ _Options planned_.
let g:matchup_delim_stopline = 1500 " generally
let g:matchup_matchparen_stopline = 400 " for match highlighting only
```
- The maps `1i%` and `1a%` are difficult to press.
You may use the following maps `I%` and `A%` for convenience:
```vim
function! s:matchup_convenience_maps()
xnoremap <sid>(std-I) I
xnoremap <sid>(std-A) A
xmap <expr> I mode()=='<c-v>'?'<sid>(std-I)':(v:count?'':'1').'i'
xmap <expr> A mode()=='<c-v>'?'<sid>(std-A)':(v:count?'':'1').'a'
for l:v in ['', 'v', 'V', '<c-v>']
execute 'omap <expr>' l:v.'I%' "(v:count?'':'1').'".l:v."i%'"
execute 'omap <expr>' l:v.'A%' "(v:count?'':'1').'".l:v."a%'"
endfor
endfunction
call s:matchup_convenience_maps()
```
Note: this is not compatible with the plugin targets.vim.
- How can I contribute?

View File

@@ -661,6 +661,24 @@ A The number of search lines is limited for performance reasons. You may
let g:matchup_delim_stopline = 1500 " generally
let g:matchup_matchparen_stopline = 400 " for match highlighting only
<
Q The maps `1i%` and `1a%` are difficult to press.
A You may use the following maps `I%` and `A%` for convenience: >
function! s:matchup_convenience_maps()
xnoremap <sid>(std-I) I
xnoremap <sid>(std-A) A
xmap <expr> I mode()=='<c-v>'?'<sid>(std-I)':(v:count?'':'1').'i'
xmap <expr> A mode()=='<c-v>'?'<sid>(std-A)':(v:count?'':'1').'a'
for l:v in ['', 'v', 'V', '<c-v>']
execute 'omap <expr>' l:v.'I%' "(v:count?'':'1').'".l:v."i%'"
execute 'omap <expr>' l:v.'A%' "(v:count?'':'1').'".l:v."a%'"
endfor
endfunction
call s:matchup_convenience_maps()
<
Note: this is not compatible with the plugin targets.vim.
Q How can I contribute?
A Read the contribution guidelines (CONTRIBUTING.md) and issue template