import-cost.nvim/doc/import-cost.txt
2026-01-10 12:14:29 -05:00

48 lines
1.6 KiB
Text

*import-cost* *import-cost.txt*
Author: Barrett Ruth <https://barrettruth.github.io>
Homepage: <https://github.com/barrettruth/import-cost.nvim>
===============================================================================
INTRODUCTION *import-cost.nvim*
import-cost.nvim displays the costs of javascript imports inside neovim.
It works with ES6 and CommonJS modules in any javascript, javascriptreact,
typescript, or typescriptreact files.
Author: Barrett Ruth <https://barrettruth.com>
===============================================================================
SETUP *import-cost.setup()*
>lua
require('import-cost').setup(config)
<
Parameters: ~
{config} `(table | nil)`: (Optional) table containing configuration for
import-cost. Defaults shown below.
Usage: ~
>lua
require('import-cost').setup({
-- Filetypes to attach to
filetypes = {
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
},
format = {
-- Format string for bytes/kilobytes in virtual text
byte_format = '%.1fb',
kb_format = '%.1fk',
-- Virtual text format (remove second "%s" to ignore gzipped size)
virtual_text = '%s (gzipped: %s)',
},
-- Highlight of virtual text —
-- a highlight group to link to or table as specified by nvim_set_hl()
highlight = 'Comment',
})
<
-------------------------------------------------------------------------------
vim:tw=80:ts=8:ft=help: