♻️ refactor(nvim): use opts instead of config function with better-escape extra

This commit is contained in:
Sergio Laín 2023-12-01 00:45:31 +01:00
parent 1364965dc8
commit a9edb662ce
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -1,15 +1,5 @@
return { return {
"max397574/better-escape.nvim", "max397574/better-escape.nvim",
config = function() opts = {},
require("better_escape").setup({ event = "InsertEnter",
mapping = { "jk", "jj", "kj", "jl" }, -- 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,
})
end,
} }