Display the costs of javascript imports inside neovim with the power of import-cost.
- Install regularly with your neovim package manager
- NOTE: pnpm is not supported because import-cost does not.
- Run
install.sh
with your node.js package manager to setup import-cost:
sh install.sh '<your-package-manager>'
For example, a config with yarn and lazy.nvim may look like the following:
require('lazy').setup {
{
'barrett-ruth/import-cost.nvim',
build = 'sh install.sh yarn',
-- if on windows
-- build = 'pwsh install.ps1 yarn',
config = true
}
}
Configure via the setup function (or use the defaults with no arguments):
require('import-cost').setup(opts)
See :h import-cost
for more information
- CommonJS support is particularly flaky - some packages work, some dont (this is by virtue of the npm module, and, thus, unavoidable)
- Long wait times - once again, the npm module may take quite a while before fully parsing packages
- pnpm problems
- wix/import-cost: provides the node backend that calculates the import costs
- import-cost: the original VSCode plugin that started it all
- vim-import-cost: inspired me to do it in neovim!