From 079befc8c08e5b311fde7fa202575ce451932fbd Mon Sep 17 00:00:00 2001 From: Heiko Blobner Date: Wed, 31 Jul 2024 14:42:01 +0200 Subject: [PATCH] ... --- .../lua/core/plugins/editor/better-escape.lua | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/dot_files/.config/nvim/lua/core/plugins/editor/better-escape.lua b/dot_files/.config/nvim/lua/core/plugins/editor/better-escape.lua index 9a1edad..b8ea47e 100644 --- a/dot_files/.config/nvim/lua/core/plugins/editor/better-escape.lua +++ b/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 -- 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 = "", -- 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 'l' or '' + "max397574/better-escape.nvim", + config = function() + require("better_escape").setup { + default_mappings = true, + mappings = { + i = { + j = { + j = "", + J = "j", + h = "h"; + H = "2b"; + l = "l", + L = "w", + K = "k", + }, + }, + }, + } end, - }, }