nvim: Fix dial.nvim

Added more rules to dial increment default group so it works on some
more cases. Fixed key bindings.
This commit is contained in:
Marty Oehme 2023-02-10 14:03:05 +01:00
parent 0484556f04
commit ee4640b186
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 33 additions and 6 deletions

View file

@ -214,12 +214,12 @@ map("n", "<localleader>w", function() require("mini.trailspace").trim() end,
{ noremap = true }) { noremap = true })
-- PLUGIN: dial-increment -- PLUGIN: dial-increment
map("n", "<C-a>", require("dial.map").inc_normal(), { noremap = true }) map("n", "<C-a>", '<Plug>(dial-increment)')
map("n", "<C-x>", require("dial.map").dec_normal(), { noremap = true }) map("n", "<C-x>", '<Plug>(dial-decrement)')
map("v", "<C-a>", require("dial.map").inc_visual(), { noremap = true }) map("v", "<C-a>", '<Plug>(dial-increment)')
map("v", "<C-x>", require("dial.map").dec_visual(), { noremap = true }) map("v", "<C-x>", '<Plug>(dial-increment)')
map("v", "g<C-a>", require("dial.map").inc_gvisual(), { noremap = true }) map("v", "g<C-a>", 'g<Plug>(dial-increment)')
map("v", "g<C-x>", require("dial.map").dec_gvisual(), { noremap = true }) map("v", "g<C-x>", 'g<Plug>(dial-increment)')
-- PLUGIN: zettelkasten.nvim -- PLUGIN: zettelkasten.nvim
map('n', '<cr>', [[:silent lua require 'zettelkasten'.link_follow()<cr>]]) map('n', '<cr>', [[:silent lua require 'zettelkasten'.link_follow()<cr>]])

View file

@ -25,6 +25,33 @@ return {
{'kylechui/nvim-surround', version = '*', config = true, event = "VeryLazy"}, -- surround things with other things using ys/cs/ds {'kylechui/nvim-surround', version = '*', config = true, event = "VeryLazy"}, -- surround things with other things using ys/cs/ds
{ {
'monaqa/dial.nvim', -- extend the ^a / ^x possibilities to dates, hex, alphabets, markdown headers 'monaqa/dial.nvim', -- extend the ^a / ^x possibilities to dates, hex, alphabets, markdown headers
config = function()
local augend = require("dial.augend")
require("dial.config").augends:register_group {
-- default augends used when no group name is specified
default = {
augend.integer.alias.decimal, augend.integer.alias.hex,
augend.date.alias["%Y/%m/%d"],
augend.date.alias["%Y-%m-%d"], augend.date.alias["%m/%d"],
augend.date.alias["%H:%M:%S"], 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.new {
elements = { "and", "or" },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
cyclic = true -- "or" is incremented into "and".
},
augend.constant
.new {
elements = { "&&", "||" },
word = false,
cyclic = true
}
}
}
end,
event = "VeryLazy" event = "VeryLazy"
}, { }, {
'tommcdo/vim-exchange', -- adds exchange operator with cx. common use: cxiw . on 2 words to switch 'tommcdo/vim-exchange', -- adds exchange operator with cx. common use: cxiw . on 2 words to switch