Skip to content

Expand a crate in your project with cargo-expand and open it in a buffer

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

chrisp60/cargo_expand.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cargo_expand.nvim

Display a selector of compilation targets from your root directory. Run cargo-expand on the selected option. Dump the results into a scratch buffer and flick on syntax highlights for said buffer.

To be clear, this plugin can be replicated by typing this into your terminal

cargo expand --lib yourlib > .expanded.rs
nvim .expanded.rs

The plugin just has the added benefit(?) of showing a vim.ui.select of the parsed cargo metadata.

Setup

  • Lazy
{
    "chrisp60/cargo_expand.nvim",
    config = function()
        vim.keymap.set("n", "[your keybind]", require("cargo_expand").expand)
    end,
}

TODO

  • Configuration options.
  • Any and all documentation, vim help docs.
  • Display compilation progress in scratch buffer.
  • support for rustc --emit={llvm-ir, asm, mir, etc..}.
    • I personally have been trying to write more unsafe code, it is nice to see how things get represented in assembly and intermediate representations.

Requirements / Credits

  • cargo-expand
  • rustc (if you are writing Rust, you have this).
  • cargo (if you are writing Rust, you have this).

License

  • MIT
  • Apache

At your choosing.

About

Expand a crate in your project with cargo-expand and open it in a buffer

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages