From ecaf12f2832f1397ab22c61c92ccd1393bd4db71 Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 31 Oct 2024 10:54:50 +0100 Subject: [PATCH] feat(config): added custom keymaps --- init.lua | 1 + lua/config/keys.lua | 132 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 lua/config/keys.lua 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 = '