-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
escape.lua
25 lines (22 loc) · 779 Bytes
/
escape.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
return {
'max397574/better-escape.nvim',
-- keymaps = {
-- { 'i', 'jk', '<Esc>', { noremap = true, silent = true, desc = 'Exit from input mode' } },
-- },
defaultConfig = {
'escape',
{
mapping = { 'jk' }, -- 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(config)
require('better_escape').setup(config.escape)
end,
}