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:
parent
d4727a3402
commit
bfbe4c36cd
2 changed files with 64 additions and 12 deletions
|
|
@ -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 = {
|
||||
{ "<C-a>", "<Plug>(dial-increment)", mode = "n" },
|
||||
{ "<C-x>", "<Plug>(dial-decrement)", mode = "n" },
|
||||
{ "<C-a>", "<Plug>(dial-increment)", mode = "v" },
|
||||
{ "<C-x>", "<Plug>(dial-increment)", mode = "v" },
|
||||
{ "g<C-a>", "g<Plug>(dial-increment)", mode = "v" },
|
||||
{ "g<C-x>", "g<Plug>(dial-increment)", mode = "v" },
|
||||
{
|
||||
"<C-s>",
|
||||
function()
|
||||
require("dial.map").manipulate("increment", "normal")
|
||||
end,
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue