File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ This also deprecated the `clear_empty_lines` setting. You can replicate this
4848behavior by setting a mapping to a function like this:
4949
5050``` lua
51- -- `k` would be the second key of a mapping
51+ -- `k` would be the end key of a mapping
5252k = function ()
5353 vim .api .nvim_input (" <esc>" )
5454 local current_line = vim .api .nvim_get_current_line ()
@@ -112,8 +112,8 @@ require("better_escape").setup {
112112 mappings = {
113113 -- mode = {
114114 -- firstkey = {
115- -- secondkey = "Escape key", -- make a key press "Escape key"
116- -- secondkey = false, -- disable a key
115+ -- endkey = "Escape key", -- make a key press "Escape key"
116+ -- endkey = false, -- disable a key
117117 -- },
118118 -- }
119119 }
@@ -134,6 +134,20 @@ mappings = {
134134 k = " <Esc>" ,
135135 j = " <Esc>" ,
136136 },
137+ -- you can also define mappings with this shorthand
138+ -- same as the example above, maps jk and jj to escape insert mode
139+ jk = " " ,
140+ jj = " " ,
141+ -- you can repeat this table pattern forever
142+ -- map jjks to do nothing
143+ j = {
144+ j = {
145+ k = " " ,
146+ },
147+ },
148+ -- you can also define mappings with this shorthand
149+ -- same as the example above, maps jjks to do nothing
150+ jjk = " " ,
137151 -- disable jj
138152 j = {
139153 j = false ,
You can’t perform that action at this time.
0 commit comments