update readme

This commit is contained in:
Barrett Ruth 2023-01-02 21:21:26 -06:00
parent 920abdd5c1
commit c5b82d1534
2 changed files with 8 additions and 9 deletions

View file

@ -17,16 +17,15 @@ SETUP *import-cost.setup()*
>lua
require('import-cost').setup(config)
<
Module setup.
Parameters: ~
{config} `(table)`: Table containing configuration for import-cost.
{config} `(table | nil)`: (Optional) table containing configuration for
import-cost. Defaults shown below.
Usage: ~
>lua
require('import-cost').setup({
-- Filetype to attach to
-- Filetypes to attach to
filetypes = {
'javascript',
'javascriptreact',
@ -35,8 +34,8 @@ Usage: ~
},
format = {
-- Format string for bytes/kilobytes in virtual text
byte_format = '%.2f b',
kb_format = '%.2f kb',
byte_format = '%.1fb',
kb_format = '%.1fk',
-- Virtual text format (remove second "%s" to ignore gzipped size)
virtual_text = '%s (gzipped: %s)',
},

View file

@ -28,7 +28,7 @@ require('lazy').setup {
## Configuration
Configure via the setup function (or just use the defaults):
Configure via the setup function (or use the defaults with no arguments):
```lua
require('import-cost').setup(opts)
@ -37,6 +37,7 @@ require('import-cost').setup(opts)
See `:h import-cost` for more information
## TODO
1. CommonJS support
## Acknowledgements
@ -45,5 +46,4 @@ See `:h import-cost` for more information
backend that calculates the import costs
2. [import-cost](https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost):
the original VSCode plugin that started it all
3. [vim-import-cost](https://github.com/yardnsm/vim-import-cOst): showed me it
was possible to do in neovim!
3. [vim-import-cost](https://github.com/yardnsm/vim-import-cOst): inspired me to do it in neovim!