From 6141f5caeae03c99845b5f30311ee07804320e8d Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sat, 9 Nov 2024 19:25:02 -0500 Subject: [PATCH] Auto commit: 2024-11-09 19:25:02 --- .config/nvim/lua/plugins/no-neck-pain.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/plugins/no-neck-pain.lua b/.config/nvim/lua/plugins/no-neck-pain.lua index e1536569..d07a37c0 100644 --- a/.config/nvim/lua/plugins/no-neck-pain.lua +++ b/.config/nvim/lua/plugins/no-neck-pain.lua @@ -1,8 +1,10 @@ local function mapPrefix(prefix, enabled) + -- create the WK group for the prefix require("which-key").add({ { prefix, group = "+NoNeckPain" }, }) - local M = { + -- define the suffix mappings + local mappings = { toggle = "p", toggleLeftSide = "ql", toggleRightSide = "qr", @@ -10,8 +12,13 @@ local function mapPrefix(prefix, enabled) widthDown = "-", scratchPad = "s", } - - return M + -- concat prefix and suffix + for action, suffix in pairs(mappings) do + mappings[action] = prefix .. suffix + end + -- include the enabled flag + mappings.enabled = enabled + return mappings end -- Ok, this plugin is really awesome! -- And everyone should know about it -- game changer!!!