From 5507afe0f4312ca99d0a637a822c62dca438d2c6 Mon Sep 17 00:00:00 2001 From: tris203 Date: Fri, 1 Dec 2023 20:03:05 +0000 Subject: [PATCH] feat: add keymap to config --- README.md | 6 ++++-- lua/hawtkeys/init.lua | 3 +++ plugin/hawtkeys.nivm/init.lua | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 plugin/hawtkeys.nivm/init.lua diff --git a/README.md b/README.md index 36493b7..e621d4d 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,16 @@ The default config is below, but can be changed by passing a table in config wit * leader is your current leader key (This will be automatic in future * homerow is the numerical representation of the home row in your keyboard layout * powerFingers contains which fingers are prefered for keystrokes, counted from a 0 index reading left to right. 0, 1, 2 ..9. -* Keyboard layout is the layout, currently on QWERTY is defined. More to follow +* keyboardLayout is the layout, currently only QWERTY is defined. More to follow +* keymap, duh ```lua { leader = " " homerow = 2 powerFingers = { 2, 3, 6, 7 } - keyboardLayout = "qwerty" + keyboardLayout = "qwerty", + keymap = "hwt" } ``` diff --git a/lua/hawtkeys/init.lua b/lua/hawtkeys/init.lua index 38db98b..22ed92c 100644 --- a/lua/hawtkeys/init.lua +++ b/lua/hawtkeys/init.lua @@ -4,6 +4,9 @@ function M.setup(config) M.homerow = config.homerow or 2 M.powerFingers = config.powerFingers or { 2, 3, 6, 7 } M.keyboardLayout = config.keyboardLayout or "qwerty" + M.keymap = config.keymap or "hwt" + vim.api.nvim_set_keymap('n', M.keymap, ':lua require("hawtkeys.ui").show()', + { noremap = true, silent = true }) end return M diff --git a/plugin/hawtkeys.nivm/init.lua b/plugin/hawtkeys.nivm/init.lua deleted file mode 100644 index 7fe9e2b..0000000 --- a/plugin/hawtkeys.nivm/init.lua +++ /dev/null @@ -1 +0,0 @@ -vim.api.nvim_set_keymap('n', 'hwt', ':lua require("hawtkeys.ui").show()', { noremap = true, silent = true })