Browse Source

...

dev_01_initial
Heiko Blobner 1 year ago
parent
commit
079befc8c0
  1. 28
      dot_files/.config/nvim/lua/core/plugins/editor/better-escape.lua

28
dot_files/.config/nvim/lua/core/plugins/editor/better-escape.lua

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

Loading…
Cancel
Save