From f069f1b01ad317c2bc102e0c609af045a756351a Mon Sep 17 00:00:00 2001 From: Natty Date: Sat, 10 Feb 2024 16:46:17 +0100 Subject: [PATCH] Added dial --- mappings.lua | 13 +++++++++++-- plugins.lua | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/mappings.lua b/mappings.lua index 34d655b..a636eb1 100644 --- a/mappings.lua +++ b/mappings.lua @@ -1,3 +1,5 @@ +local dial = require("dial.map") + return { n = { [""] = {"db", desc = "Ctrl+Backspace to delete a word backwards"}, @@ -10,7 +12,15 @@ return { [""] = {"j", desc = "Go to the window down"}, ["K"] = {require("hover").hover, desc = "Show hover.nvim popup"}, [""] = {":Telescope buffers", desc = "Show Telescope for open buffers"}, - [""] = {":Telescope registers", desc = "Show Telescope for register paste"} + [""] = {":Telescope registers", desc = "Show Telescope for register paste"}, + [""] = {dial.manipulate("increment", "normal"), desc = "Increment number"}, + [""] = {dial.manipulate("decrement", "normal"), desc = "Decrement number"}, + [""] = {false, desc = "Decrement number (unused)"} + }, + v = { + [""] = {dial.manipulate("increment", "visual"), desc = "Increment number"}, + [""] = {dial.manipulate("decrement", "visual"), desc = "Decrement number"}, + [""] = {false, desc = "Decrement number (unused)"} }, i = { ["\b"] = {"db", desc = "Ctrl+Backspace to delete a word backwards"}, @@ -18,4 +28,3 @@ return { [""] = {"dw", desc = "Ctrl+Delete to delete a word forwards"} } } - diff --git a/plugins.lua b/plugins.lua index ac3dd29..bdba95f 100644 --- a/plugins.lua +++ b/plugins.lua @@ -373,4 +373,21 @@ return {{ }, }) end, +}, { + "monaqa/dial.nvim", + config = function() + -- Increment and decrement these groups with a keybind + local augend = require("dial.augend") + require("dial.config").augends:register_group({ + ["default"] = { + augend.integer.alias.decimal, + augend.integer.alias.hex, + augend.date.alias["%Y/%m/%d"], + augend.date.alias["%Y-%m-%d"], + augend.semver.alias.semver, + augend.misc.alias.markdown_header, + augend.constant.alias.bool + } + }) + end }}