|
|
|
@ -19,10 +19,11 @@ M.misc = function()
|
|
|
|
|
-- 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 })
|
|
|
|
|
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
|
|
|
|
|
map("", "j", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
|
|
|
|
map("", "k", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
|
|
|
|
map("", "<Down>", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
|
|
|
|
map("", "<Up>", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
|
|
|
|
|
|
|
|
|
-- use ESC to turn off search highlighting
|
|
|
|
|
map("n", "<Esc>", ":noh <CR>")
|
|
|
|
|