From fed62f3b6d9b4c2fa27f9cdccb14e60f4f36a8da Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sun, 8 Jan 2023 13:59:17 +0100 Subject: [PATCH] vim:keys: Keep the cursor position when formatting Quickly formatting multiple paragraphs is now not as simple as before, but the benefits still prevail. --- .config/vim/vimrc.d/40-keys.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index c640b56..8db75bb 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -200,8 +200,8 @@ inoremap u nnoremap gm :Man xnoremap gm :Man -" Format the current paragraph -nmap Q gqap +" Format the current paragraph, while keeping the cursor position +nmap Q gwap " Swap movement mappings that act on display lines with the normal ones, making " it easier to navigate long wrapped lines.