@@ -16,16 +16,16 @@ Use your favourite plugin manager
1616- Lazy:
1717``` lua
1818return {
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 {
4040You 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+
0 commit comments