diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index c4f8a050..47c81ab7 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -22,5 +22,22 @@ return { cmp_autopairs.on_confirm_done() ) end + }, + + -- Better escape: press jj or jk to get out of insert mode + { + "max397574/better-escape.nvim", + config = function() + require("better_escape").setup { + mapping = { "jk", "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 '' + -- end, + } + end, } }