added dial

This commit is contained in:
Oliver Hartmann 2025-04-29 23:02:55 +02:00
parent 0264be4c7c
commit 6b5f89632c

23
lua/plugins/dial.lua Normal file
View File

@ -0,0 +1,23 @@
return {
'monaqa/dial.nvim',
keys = {
{ '<C-a>', function() return require('dial.map').inc_normal() end, expr = true, desc = 'Increment' },
{ '<C-x>', function() return require('dial.map').dec_normal() end, expr = true, desc = 'Decrement' },
{ '<C-a>', function() return require('dial.map').inc_visual() end, mode = 'v', expr = true, desc = 'Increment' },
{ '<C-x>', function() return require('dial.map').dec_visual() end, mode = 'v', expr = true, desc = 'Decrement' },
},
config = function()
local augends = require('dial.augend')
require('dial.config').augends:register_group({
-- default augends used when no group name is specified
default = {
augends.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
augends.integer.alias.hex, -- nonnegative hex number (0x0, 0x1, 0x2, ...)
augends.date.alias['%Y/%m/%d'], -- date (2027/04/15, etc.)
augends.constant.alias.bool, -- boolean value (true <-> false)
augends.constant.new({ elements = { 'True', 'False' } }),
augends.constant.new({ elements = { 'TRUE', 'FALSE' } }),
},
})
end,
}