diff --git a/init.lua b/init.lua index b7bdb64..c184041 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,3 @@ require("config.lazy") require("config.opts") +require("config.keys") diff --git a/lua/config/keys.lua b/lua/config/keys.lua new file mode 100644 index 0000000..82feb80 --- /dev/null +++ b/lua/config/keys.lua @@ -0,0 +1,132 @@ + +local keymaps = { + -- + -- Write buffer to disk + -- .............................................. + { + mode = { 'n', 'i' }, + keys = '', + cmd = vim.cmd.write, + desc = "Write buffer to disk" + }, + { + mode = { 'n', 'i' }, + keys = '', + cmd = vim.cmd.undo, + desc = "Undo last edit" + }, + { + mode = { 'n', 'i' }, + keys = '', + cmd = vim.cmd.redo, + desc = "Redo last edit that was undone" + }, + -- + -- Shift line(s) by one shiftwidth + -- .............................................. + { + mode = { 'n', 'i' }, + keys = '', + cmd = ':<', + desc = "Shift cursor line left" + }, + { + mode = { 'n', 'i' }, + keys = '', + cmd = ':>', + desc = "Shift cursor line right" + }, + { + mode = { 'v' }, + keys = '', + cmd = '>gv', + desc = "Shift selection in visual mode right" + }, + { + mode = { 'v' }, + keys = '', + cmd = '