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

View file

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