No description
Find a file
2023-01-12 09:56:53 +09:00
.github/ISSUE_TEMPLATE workflow: remove terminal from issue template 2023-01-04 11:18:08 -06:00
doc docs: remove duplicate tag (#3) 2023-01-04 10:10:44 -06:00
lua install: error if plugin installed incorrectly 2023-01-05 12:55:04 -06:00
.gitignore initial commit 2022-12-31 14:08:30 -06:00
.stylua.toml initial commit 2022-12-31 14:08:30 -06:00
index.js fix detecting lang 2023-01-12 09:56:53 +09:00
install.sh install(#6): use HTTPS in clone 2023-01-07 16:52:22 -06:00
readme.md readme: known issues 2023-01-09 16:50:01 -06:00

import-cost.nvim

Display the costs of javascript imports inside neovim with the power of import-cost.

preview

Installation

  1. Install regularly with your neovim package manager
  2. 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'
    }
}

Configuration

Configure via the setup function (or use the defaults with no arguments):

require('import-cost').setup(opts)

See :h import-cost for more information

Known Issues

  1. CommonJS support is particularly flaky - some packages work, some dont (this is by virtue of the npm module, and, thus, unavoidable)
  2. Long wait times - once again, the npm module may take quite a while before fully parsing packages
  3. pnpm problems

Acknowledgements

  1. wix/import-cost: provides the node backend that calculates the import costs
  2. import-cost: the original VSCode plugin that started it all
  3. vim-import-cost: inspired me to do it in neovim!