diff --git a/lua/mappings.lua b/lua/mappings.lua index 815bf4d6..17848db0 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -26,6 +26,14 @@ vim.api.nvim_set_keymap("t", "jk", "", {}) -- Don't copy the replaced text after pasting in visual mode map("v", "p", '"_dP', opt) +-- Allow moving the cursor through wrapped lines with j, k, and +-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ +-- empty mode is same as using :map +map("", "j", 'v:count ? "j" : "gj"', {expr = true}) +map("", "k", 'v:count ? "k" : "gk"', {expr = true}) +map("", "", 'v:count ? "j" : "gj"', {expr = true}) +map("", "", 'v:count ? "k" : "gk"', {expr = true}) + -- OPEN TERMINALS -- map("n", "", ":vnew +terminal | setlocal nobuflisted ", opt) -- term over right map("n", "", ":10new +terminal | setlocal nobuflisted ", opt) -- term bottom