From 2781aabb1bf923c52781e707d0159a9444762d8e Mon Sep 17 00:00:00 2001 From: Sebastian Burschel Date: Thu, 2 Dec 2021 12:06:44 +0100 Subject: [PATCH] Added better version --- dotfiles/.vimrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dotfiles/.vimrc b/dotfiles/.vimrc index 5536585..2f061d3 100644 --- a/dotfiles/.vimrc +++ b/dotfiles/.vimrc @@ -220,9 +220,12 @@ set omnifunc=syntaxcomplete#Complete " Keep 8 rows above and below the kk set scrolloff=8 -" Jump to wrapped line instead of next real line. -nnoremap k (v:count == 0 ? 'gk' : 'k') -nnoremap j (v:count == 0 ? 'gj' : 'j') +" Jump to wrapped line instead of next real line. But still respect the line +" numbering when doing bigger steps. Also adds jumps bigger than 5 to the jump +" list +" source: https://www.vi-improved.org/vim-tips/ +nnoremap j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj' +nnoremap k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk' " Use e and E to jump to start or end of a line.