Skip to content

barrettruth/import-cost.nvim

Repository files navigation

import-cost.nvim

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.

preview

Installation

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.

Quick Start

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',
}

Documentation

:help import-cost

Known Issues

  1. CommonJS support is flaky (limitation of the npm module)
  2. Long wait times for large packages
  3. pnpm is not supported

Acknowledgements

About

[mirror of git.barrettruth.com/barrettruth/import-cost.nvim] display javascript import costs inside of neovim

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors