A duck that waddles between your codes
Coding? release the duck.
bored? release the duck.
not bored? release the duck.
{
'tamton-aquib/duck.nvim',
config = function()
vim.keymap.set('n', '<leader>dd', function() require("duck").hatch() end, {})
vim.keymap.set('n', '<leader>dk', function() require("duck").cook() end, {})
vim.keymap.set('n', '<leader>da', function() require("duck").cook_all() end, {})
end
}
To set custom character:
nnoremap <leader>dd :lua require("duck").hatch("ΰΆ")<CR>
popular candidates: π¦ ΰΆ π¦ π π π¦ π€
You can also specify how fast a duck moves (measured in steps per second):
vim.keymap.set('n', '<leader>dd', function() require("duck").hatch("π¦", 10) end, {}) -- A pretty fast duck
vim.keymap.set('n', '<leader>dc', function() require("duck").hatch("π", 0.75) end, {}) -- Quite a mellow cat
hatch function support a strategy to pass to override the current one.
for example, the following strategy always push the duck to the right:
local always_right_strategy = function(positions) -- {col = <val>, row = <val>}
return {col = positions.col + 1, row = positions.row}
end
require("duck").hatch("π¦", 5, "none", always_right_strategy)
This strategies is available at
require("duck").default_strategies.always_right_strategy
- can release multiple ducks.
- does not load on startup.
- Light weight, <100 LOC
- Its a duck
- custom strategies for new position