Skip to content

Commit 5ebf924

Browse files
committed
update docs
1 parent 6a60610 commit 5ebf924

File tree

2 files changed

+53
-19
lines changed

2 files changed

+53
-19
lines changed

README.md

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ Use your favourite plugin manager
1616
- Lazy:
1717
```lua
1818
return {
19-
'cjodo/convert.nvim',
20-
dependencies = {
21-
'MunifTanjim/nui.nvim'
22-
},
23-
keys = {
24-
{ "<leader>cn", "<cmd>ConvertFindNext<CR>", desc = "Find next convertable unit" },
25-
{ "<leader>cc", "<cmd>ConvertFindCurrent<CR>", desc = "Find convertable unit in current line" },
19+
'cjodo/convert.nvim',
20+
dependencies = {
21+
'MunifTanjim/nui.nvim'
22+
},
23+
keys = {
24+
{ "<leader>cn", "<cmd>ConvertFindNext<CR>", desc = "Find next convertable unit" },
25+
{ "<leader>cc", "<cmd>ConvertFindCurrent<CR>", desc = "Find convertable unit in current line" },
2626
-- Add "v" to enable converting only a selected region
27-
{ "<leader>ca", "<cmd>ConvertAll<CR>", mode = {"n", "v"} desc = "Convert all of a specified unit" },
28-
},
27+
{ "<leader>ca", "<cmd>ConvertAll<CR>", mode = {"n", "v"} desc = "Convert all of a specified unit" },
28+
},
2929
}
3030
```
3131
## Commands:
@@ -40,17 +40,52 @@ return {
4040
You can choose you're own custom keys for the ui menu
4141

4242
```lua
43-
config = function()
43+
config = function()
4444
local convert = require('convert')
4545
-- defaults
4646
convert.setup({
47-
keymaps = {
48-
focus_next = { "j", "<Down>", "<Tab>" },
49-
focus_prev = { "k", "<Up>", "<S-Tab>" },
50-
close = { "<Esc>", "<C-c>", 'qq' },
51-
submit = { "<CR>", "<Space>" },
52-
}
47+
keymaps = {
48+
focus_next = { "j", "<Down>", "<Tab>" },
49+
focus_prev = { "k", "<Up>", "<S-Tab>" },
50+
close = { "<Esc>", "<C-c>", 'qq' },
51+
submit = { "<CR>", "<Space>" },
52+
},
53+
modes = { "color", "size", "numbers" } -- available conversion modes
5354
})
54-
end
55+
end
5556

5657
```
58+
## Supported Conversions
59+
60+
### Size Units 📏
61+
62+
| Unit | Description |
63+
|------|------------|
64+
| `px` | Pixels |
65+
| `rem` | Relative to root element |
66+
| `cm` | Centimeters |
67+
| `in` | Inches |
68+
| `mm` | Millimeters |
69+
| `pt` | Points |
70+
| `pc` | Picas |
71+
72+
---
73+
74+
### Color Formats 🎨
75+
76+
| Format | Description |
77+
|--------|------------|
78+
| `rgb` | Red-Green-Blue |
79+
| `hex` | Hexadecimal color code |
80+
| `hsl` | Hue-Saturation-Lightness |
81+
82+
---
83+
84+
### Number Systems 🔢
85+
86+
| Format | Description |
87+
|-------------|------------|
88+
| `bin` | Binary |
89+
| `hexadecimal` | Hexadecimal |
90+
| `octal` | Octal |
91+

lua/convert/ui/open_popup.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@ local size_menu = {
4343
}
4444

4545
local number_menu = {
46-
Menu.item('binary'),
46+
Menu.item('bin'),
4747
Menu.item('hexadecimal'),
4848
Menu.item('octal'),
4949
}
5050

5151
local M = {}
5252

53-
5453
---@param found_unit matched
5554
M.open_win = function(found_unit)
5655
local lines = nil

0 commit comments

Comments
 (0)