diff options
author | Teddy Wing | 2020-09-26 13:50:44 +0200 |
---|---|---|
committer | Teddy Wing | 2020-09-29 01:15:08 +0200 |
commit | 802d388c9dcc1c75b0acd8bcfe75cbd66c76838d (patch) | |
tree | f23b5abb6d10f561f8f78fa25c0a5fbb817ccb1d /plugin | |
parent | 8a05e0113d49585ba1c22251695d5478b1c634ca (diff) | |
download | vim-grappele-802d388c9dcc1c75b0acd8bcfe75cbd66c76838d.tar.bz2 |
Trying to fix omap (WIP)
gG omap works characterwise but should work linewise.
Adding V to the gG omap causes >17G to indent 17 times instead of once.
Try changing `G` to an `<expr>` mapping to simplify the code, allowing
it to work more exactly like the normal `G`. This resulted in moving the
logic to `grappele#Recall()`, causing problems for `gG`.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/grappele.vim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugin/grappele.vim b/plugin/grappele.vim index 9ab1400..e04c8e4 100644 --- a/plugin/grappele.vim +++ b/plugin/grappele.vim @@ -4,22 +4,22 @@ endif let g:loaded_grappele = 1 -nnoremap <silent> <Plug>Grappele :<c-u>call grappele#Grappele(v:count, 'n')<cr> -nnoremap <silent> <Plug>GrappeleRecall :<c-u>call grappele#Recall('n')<cr> -vnoremap <silent> <Plug>GrappeleRecall :<c-u>call grappele#Recall('v')<cr> -onoremap <silent> <Plug>GrappeleRecall :<c-u>call grappele#Recall('o')<cr> +nnoremap <silent> <Plug>Grappele grappele#Grappele(v:count, 'n') +nnoremap <silent> <Plug>GrappeleRecall :<C-u>call grappele#Recall('n')<cr> +vnoremap <silent> <Plug>GrappeleRecall :<C-u>call grappele#Recall('v')<cr> +onoremap <silent> <Plug>GrappeleRecall :<C-u>call grappele#Recall('o')<cr> if !hasmapto('<Plug>Grappele') || !maparg('G', 'n') - nnoremap <silent> G :<c-u>call grappele#Grappele(v:count, 'n')<cr> + nnoremap <silent> <expr> G grappele#Grappele(v:count, 'n') endif if !hasmapto('<Plug>Grappele') || !maparg('G', 'v') - vnoremap <silent> G - \ :<c-u>call grappele#Grappele(v:count, 'v', visualmode())<cr> + vnoremap <silent> <expr> G + \ grappele#Grappele(v:count, 'v', visualmode()) endif if !hasmapto('<Plug>Grappele') || !maparg('G', 'o') - onoremap <silent> G :<c-u>call grappele#Grappele(v:count, 'o')<cr> + onoremap <silent> <expr> G grappele#Grappele(v:count, 'o') endif if !hasmapto('<Plug>GrappeleRecall') || !maparg('gG', 'n') |