Display javascript import costs inside neovim, powered by import-cost.
Note
Due to GitHub's historic unreliability, active development is hosted on
Forgejo.
GitHub is maintained as a read-only mirror.
See :help import-cost-migration to optionally update your plugin source
configuration.
With vim.pack (Neovim 0.12+):
vim.pack.add({
'https://git.barrettruth.com/barrettruth/import-cost.nvim',
})Or via luarocks:
luarocks install import-cost.nvim
Dependencies are installed automatically on first use.
Open a JavaScript, TypeScript, or Svelte file with import statements and wait for inline virtual text costs to appear.
If the defaults need changing, set vim.g.import_cost before the plugin
loads.
vim.g.import_cost = {
package_manager = 'yarn',
format = {
virtual_text = '%s',
},
highlight = 'Comment',
}:help import-cost- CommonJS support is flaky (limitation of the npm module)
- Long wait times for large packages
- pnpm is not supported
- wix/import-cost: node backend
- import-cost: original VSCode plugin
- vim-import-cost: vim inspiration
