From 8126766ab7a37961096ff9edf69feed15d9f3b65 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 29 Sep 2020 01:34:50 +0200 Subject: autoload/grappele.vim: If no line is stored, make `gG` a no-op Previously, if you typed, for example: dgGk this would perform `dk`, deleting the current line and the one above it. That doesn't really make any sense. Instead, the `gG` should cancel the operator. Do this by mapping to ``. In normal and visual modes, `gG` would move the cursor to the 0th column. Returning an empty {rhs} causes the cursor to stay in the same position it was in before pressing `gG`. --- autoload/grappele.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/grappele.vim b/autoload/grappele.vim index e111409..c0835c9 100644 --- a/autoload/grappele.vim +++ b/autoload/grappele.vim @@ -10,10 +10,14 @@ function! grappele#Recall() if exists('s:line') return s:line . 'G' endif + + return '' endfunction function! grappele#ORecall() if exists('s:line') return ':normal! V' . s:line . "G\" endif + + return "\" endfunction -- cgit v1.2.3