From 4c111c0e3b05844f84f62cef74734d3a2da52710 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Thu, 22 Dec 2022 10:55:16 +0100 Subject: [PATCH] vim:keys: Make display-line movements the default I'd rather have the movement mappings behave on display-lines to make it easier when navigating in very long lines. --- .config/vim/vimrc.d/40-keys.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index c778850..59519df 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -198,6 +198,19 @@ xnoremap gm :Man " Format the current paragraph nmap Q gqap +" Swap movement mappings that act on display lines with the real ones, making it +" easier to navigate long wrapped lines. +noremap j gj +noremap k gk +noremap 0 g0 +noremap ^ g^ +noremap $ g$ +noremap gj j +noremap gk k +noremap g0 0 +noremap g^ ^ +noremap g$ $ + " Convert Unix timestamp to human readable " Mnemonic: "Unix timestamp convert" with pun to UTC nnoremap utc ciw=strftime("%F %T", @")