diff --git a/doc/import-cost.txt b/doc/import-cost.txt index f727d4a..c9cbd09 100644 --- a/doc/import-cost.txt +++ b/doc/import-cost.txt @@ -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)', }, diff --git a/readme.md b/readme.md index bebd641..d75f419 100644 --- a/readme.md +++ b/readme.md @@ -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!