Home

Awesome

convert.nvim

demo

Dependencies

Features

Installation:

Use your favourite plugin manager

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" },
    { "<leader>ca", "<cmd>ConvertAll<CR>", desc = "Convert all of a specified unit" },
  },
}

Usage

You can choose you're own custom keys for the ui menu

  config = function()
    local convert = require('convert')
    -- defaults
    convert.setup({
      keymaps = {
        focus_next = { "j", "<Down>", "<Tab>" },
        focus_prev = { "k", "<Up>", "<S-Tab>" },
        close = { "<Esc>", "<C-c>", 'qq' },
        submit = { "<CR>", "<Space>" },
      }
    })
  end

Commands:

CommandDescription
:ConvertFindNextFinds the next convertible unit
:ConvertFindCurrentFinds the convertible unit in the current line
:ConvertAllConverts all instances of a given unit to another