mappings: Allow moving the cursor through wrapped lines normally

This doesn't affect any other stuff like 10j or 10k
This commit is contained in:
Akianonymus 2021-07-26 14:32:29 +05:30
parent 11d75cf597
commit 268c37e52f
1 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,14 @@ vim.api.nvim_set_keymap("t", "jk", "<esc>", {})
-- 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, <Up> and <Down>
-- 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("", "<Down>", 'v:count ? "j" : "gj"', {expr = true})
map("", "<Up>", 'v:count ? "k" : "gk"', {expr = true})
-- OPEN TERMINALS --
map("n", "<C-l>", ":vnew +terminal | setlocal nobuflisted <CR>", opt) -- term over right
map("n", "<C-x>", ":10new +terminal | setlocal nobuflisted <CR>", opt) -- term bottom