From af27cdea360427bab53f69877d73734759d4061c Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Wed, 12 Apr 2023 12:08:11 +0200 Subject: [PATCH] feat(vim): add wrapped line movement control --- .config/nvim/lua/keybindings.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/nvim/lua/keybindings.lua b/.config/nvim/lua/keybindings.lua index 823a722..e4ea154 100644 --- a/.config/nvim/lua/keybindings.lua +++ b/.config/nvim/lua/keybindings.lua @@ -55,3 +55,7 @@ map('', 't', ":TableFormat") -- Open lazy.nvim menu map('', 'lh', ":Lazy home") + +-- Allow transparent scrolling through wrapped lines +vim.api.nvim_set_keymap("n", "k", "v:count == 0 ? 'gk' : 'k'", { noremap = true, expr = true, silent = true }) +vim.api.nvim_set_keymap("n", "j", "v:count == 0 ? 'gj' : 'j'", { noremap = true, expr = true, silent = true })