nvim: Update dial version and changed key maps

Changed maps to increment on <C-S> (instead of the usual <C-A>) and
decrement on the typical <C-X>. This makes it work much better with
wezterm leader key (<C-A>) and as far as I can see does not directly
clash with any other binds.
This commit is contained in:
Marty Oehme 2024-08-12 21:16:23 +02:00
parent d4727a3402
commit bfbe4c36cd
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 64 additions and 12 deletions

View file

@ -23,7 +23,7 @@
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" }, "completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" },
"conform.nvim": { "branch": "master", "commit": "acc7337cfd24ddfa3109bfc8c258c09c88c5c450" }, "conform.nvim": { "branch": "master", "commit": "acc7337cfd24ddfa3109bfc8c258c09c88c5c450" },
"dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" }, "dial.nvim": { "branch": "master", "commit": "ed4d6a5bbd5e479b4c4a3019d148561a2e6c1490" },
"dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" }, "dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" },
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
"flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" }, "flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" },

View file

@ -1,10 +1,12 @@
return { return {
-- surround things with other things using ys/cs/ds -- 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", "monaqa/dial.nvim",
version = false,
config = function() config = function()
local augend = require("dial.augend") local augend = require("dial.augend")
require("dial.config").augends:register_group({ require("dial.config").augends:register_group({
@ -12,6 +14,7 @@ return {
default = { default = {
augend.integer.alias.decimal, augend.integer.alias.decimal,
augend.integer.alias.hex, augend.integer.alias.hex,
augend.hexcolor.new({ case = "lower" }),
augend.date.alias["%Y/%m/%d"], augend.date.alias["%Y/%m/%d"],
augend.date.alias["%Y-%m-%d"], augend.date.alias["%Y-%m-%d"],
augend.date.alias["%m/%d"], augend.date.alias["%m/%d"],
@ -19,11 +22,10 @@ return {
augend.date.alias["%H:%M"], augend.date.alias["%H:%M"],
augend.constant.alias.de_weekday_full, augend.constant.alias.de_weekday_full,
augend.constant.alias.de_weekday, augend.constant.alias.de_weekday,
augend.constant.alias.bool,
augend.semver.alias.semver, augend.semver.alias.semver,
augend.constant.alias.Alpha, augend.constant.alias.Alpha,
augend.constant.alias.alpha, augend.constant.alias.alpha,
augend.hexcolor.new({ case = "lower" }), augend.constant.alias.bool,
augend.constant.new({ augend.constant.new({
elements = { "and", "or" }, elements = { "and", "or" },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
@ -37,14 +39,64 @@ return {
}, },
}) })
end, end,
event = "InsertEnter", event = { "CursorHold", "InsertEnter" },
keys = { keys = {
{ "<C-a>", "<Plug>(dial-increment)", mode = "n" }, {
{ "<C-x>", "<Plug>(dial-decrement)", mode = "n" }, "<C-s>",
{ "<C-a>", "<Plug>(dial-increment)", mode = "v" }, function()
{ "<C-x>", "<Plug>(dial-increment)", mode = "v" }, require("dial.map").manipulate("increment", "normal")
{ "g<C-a>", "g<Plug>(dial-increment)", mode = "v" }, end,
{ "g<C-x>", "g<Plug>(dial-increment)", mode = "v" }, mode = "n",
},
{
"<C-x>",
function()
require("dial.map").manipulate("decrement", "normal")
end,
mode = "n",
},
{
"<C-s>",
function()
require("dial.map").manipulate("increment", "visual")
end,
mode = "v",
},
{
"<C-x>",
function()
require("dial.map").manipulate("decrement", "visual")
end,
mode = "v",
},
{
"g<C-s>",
function()
require("dial.map").manipulate("increment", "gnormal")
end,
mode = "n",
},
{
"g<C-x>",
function()
require("dial.map").manipulate("decrement", "gnormal")
end,
mode = "n",
},
{
"g<C-s>",
function()
require("dial.map").manipulate("increment", "gvisual")
end,
mode = "v",
},
{
"g<C-x>",
function()
require("dial.map").manipulate("decrement", "gvisual")
end,
mode = "v",
},
}, },
}, },
} }