You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return {
'cjodo/convert.nvim',
dependencies= {
'MunifTanjim/nui.nvim'
},
keys= {
{ "<leader>cn", "<cmd>ConvertFindNext<CR>", desc="Find next convertable unit" },
{ "<leader>cc", "<cmd>ConvertFindCurrent<CR>", desc="Find convertable unit in current line" },
-- Add "v" to enable converting a selected region
{ "<leader>ca", "<cmd>ConvertAll<CR>", mode= {"n", "v"}, desc="Convert all of a specified unit" },
},
}
Packer:
use {
'cjodo/convert.nvim',
requires= { 'MunifTanjim/nui.nvim' },
config=function()
require('convert').setup()
vim.keymap.set('n', '<leader>cn', '<cmd>ConvertFindNext<CR>', { desc='Find next convertible unit' })
vim.keymap.set('n', '<leader>cc', '<cmd>ConvertFindCurrent<CR>', { desc='Find convertible unit in current line' })
vim.keymap.set({ 'n', 'v' }, '<leader>ca', '<cmd>ConvertAll<CR>', { desc='Convert all of a specified unit' })
end
}
Commands:
Command
Description
:ConvertFindNext
Finds the next convertible unit
:ConvertFindCurrent
Finds the convertible unit in the current line (starting from cursor)
:ConvertAll
Converts all instances in a buffer or visual mode selection of one unit to another of the same type (size, color)
Usage
You can choose you're own custom keys for the ui menu