|
|
|
@ -5,14 +5,22 @@ |
|
|
|
-- will be inserted. Then you always get a delay when typing a j |
|
|
|
return { |
|
|
|
"max397574/better-escape.nvim", |
|
|
|
opts = { |
|
|
|
mapping = {"jk", "kj", "jj"}, -- a table with mappings to use |
|
|
|
timeout = vim.o.timeoutlen, -- the time in which the keys must be hit in ms. Use option timeoutlen by default |
|
|
|
clear_empty_lines = false, -- clear line after escaping if there is only whitespace |
|
|
|
--keys = "<Esc>", -- keys used for escaping, if it is a function will use the result everytime |
|
|
|
-- example(recommended) |
|
|
|
keys = function() |
|
|
|
return vim.api.nvim_win_get_cursor(0)[2] > 1 and '<esc>l' or '<esc>' |
|
|
|
end, |
|
|
|
config = function() |
|
|
|
require("better_escape").setup { |
|
|
|
default_mappings = true, |
|
|
|
mappings = { |
|
|
|
i = { |
|
|
|
j = { |
|
|
|
j = "<Esc>", |
|
|
|
J = "<Esc>j", |
|
|
|
h = "<Esc>h"; |
|
|
|
H = "<Esc>2b"; |
|
|
|
l = "<Esc>l", |
|
|
|
L = "<Esc>w", |
|
|
|
K = "<Esc>k", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
end, |
|
|
|
} |
|
|
|
|