From bfbe4c36cdd05b40d0ddf61ff57defd6c0412066 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 12 Aug 2024 21:16:23 +0200 Subject: [PATCH] nvim: Update dial version and changed key maps Changed maps to increment on (instead of the usual ) and decrement on the typical . This makes it work much better with wezterm leader key () and as far as I can see does not directly clash with any other binds. --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/plugins/editing.lua | 74 +++++++++++++++++++---- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 80d2e67..4db46f9 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -23,7 +23,7 @@ "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" }, "conform.nvim": { "branch": "master", "commit": "acc7337cfd24ddfa3109bfc8c258c09c88c5c450" }, - "dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" }, + "dial.nvim": { "branch": "master", "commit": "ed4d6a5bbd5e479b4c4a3019d148561a2e6c1490" }, "dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" }, "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, "flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" }, diff --git a/nvim/.config/nvim/lua/plugins/editing.lua b/nvim/.config/nvim/lua/plugins/editing.lua index d926dc0..cf1d246 100644 --- a/nvim/.config/nvim/lua/plugins/editing.lua +++ b/nvim/.config/nvim/lua/plugins/editing.lua @@ -1,10 +1,12 @@ return { -- surround things with other things using ys/cs/ds - { "kylechui/nvim-surround", config = true, event = "VeryLazy" }, + { "kylechui/nvim-surround", config = true, event = { "CursorHold", "InsertEnter" } }, - -- extend the ^a / ^x possibilities to dates, hex, alphabets, markdown headers + -- extend the ^x / ^a possibilities to dates, hex, alphabets, markdown headers + -- REMAPPED TO C-X / C-S for decrement/increment { "monaqa/dial.nvim", + version = false, config = function() local augend = require("dial.augend") require("dial.config").augends:register_group({ @@ -12,6 +14,7 @@ return { default = { augend.integer.alias.decimal, augend.integer.alias.hex, + augend.hexcolor.new({ case = "lower" }), augend.date.alias["%Y/%m/%d"], augend.date.alias["%Y-%m-%d"], augend.date.alias["%m/%d"], @@ -19,11 +22,10 @@ return { augend.date.alias["%H:%M"], augend.constant.alias.de_weekday_full, augend.constant.alias.de_weekday, - augend.constant.alias.bool, augend.semver.alias.semver, augend.constant.alias.Alpha, augend.constant.alias.alpha, - augend.hexcolor.new({ case = "lower" }), + augend.constant.alias.bool, augend.constant.new({ elements = { "and", "or" }, word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. @@ -37,14 +39,64 @@ return { }, }) end, - event = "InsertEnter", + event = { "CursorHold", "InsertEnter" }, keys = { - { "", "(dial-increment)", mode = "n" }, - { "", "(dial-decrement)", mode = "n" }, - { "", "(dial-increment)", mode = "v" }, - { "", "(dial-increment)", mode = "v" }, - { "g", "g(dial-increment)", mode = "v" }, - { "g", "g(dial-increment)", mode = "v" }, + { + "", + function() + require("dial.map").manipulate("increment", "normal") + end, + mode = "n", + }, + { + "", + function() + require("dial.map").manipulate("decrement", "normal") + end, + mode = "n", + }, + { + "", + function() + require("dial.map").manipulate("increment", "visual") + end, + mode = "v", + }, + { + "", + function() + require("dial.map").manipulate("decrement", "visual") + end, + mode = "v", + }, + { + "g", + function() + require("dial.map").manipulate("increment", "gnormal") + end, + mode = "n", + }, + { + "g", + function() + require("dial.map").manipulate("decrement", "gnormal") + end, + mode = "n", + }, + { + "g", + function() + require("dial.map").manipulate("increment", "gvisual") + end, + mode = "v", + }, + { + "g", + function() + require("dial.map").manipulate("decrement", "gvisual") + end, + mode = "v", + }, }, }, }