We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 344bff5 commit c7c4628Copy full SHA for c7c4628
lua/plugins/better-escape.lua
@@ -1,15 +1,15 @@
1
+--- Ensure the cursor is where i expect it to be after escaping
2
+local function esc() return vim.api.nvim_win_get_cursor(0)[2] > 1 and "<esc>l" or "<esc>" end
3
---@type LazySpec
4
return {
5
"max397574/better-escape.nvim",
6
opts = {
7
mappings = {
8
i = {
- j = { k = "<Esc>" },
- k = { j = "<Esc>" },
9
+ j = { k = esc },
10
+ k = { j = esc },
11
},
12
- --- Ensure the cursor is where i expect it to be after escaping
- keys = function() return vim.api.nvim_win_get_cursor(0)[2] > 1 and "<esc>l" or "<esc>" end,
13
14
event = { "InsertEnter" },
15
}
0 commit comments