Home

Awesome

ferris.nvim 🦀

a neovim plugin for interacting with Rust Analyzer's LSP extensions

installation & usage

note: this plugin has only been tested with neovim 0.9+

with lazy.nvim:

{
    'vxpm/ferris.nvim'
    opts = {
        -- your options here
    }
}

the available options (and their default values) are:

{
    -- If true, will automatically create commands for each LSP method
    create_commands = true, -- bool
    -- Handler for URL's (used for opening documentation)
    url_handler = "xdg-open", -- string | function(string)
}

you can also manually call the methods by requiring them:

local view_mem_layout = require("ferris.methods.view_memory_layout")

-- call the returned function to execute the request
view_mem_layout()

don't forget to call setup on require("ferris") beforehand, though! (not needed if you're using the opts field in lazy.nvim)

available methods

<sub><sup>please do not mind the terrible screenshots... i was too lazy</sub></sup>

<details> <summary>Expand Macro</summary>

require("ferris.methods.expand_macro")

image.png

</details> <details> <summary>Join Lines</summary>

require("ferris.methods.join_lines")

</details> <details> <summary>View HIR</summary>

require("ferris.methods.view_hir")

image.png

</details> <details> <summary>View MIR</summary>

require("ferris.methods.view_mir")

image.png

</details> <details> <summary>View Memory Layout</summary>

require("ferris.methods.view_memory_layout")

image.png

</details> <details> <summary>View Item Tree</summary>

require("ferris.methods.view_item_tree")

</details> <details> <summary>View Syntax Tree</summary>

require("ferris.methods.view_syntax_tree")

</details> <details> <summary>Open Cargo.toml</summary>

require("ferris.methods.open_cargo_toml")

</details> <details> <summary>Open Parent Module</summary>

require("ferris.methods.open_parent_module")

</details> <details> <summary>Open Documentation</summary>

require("ferris.methods.open_documentation")

</details> <details> <summary>Reload Workspace</summary>

require("ferris.methods.reload_workspace")

</details> <details> <summary>Rebuild Macros</summary>

require("ferris.methods.rebuild_macros")

</details>

special thanks

rust-tools for being the reason why this plugins exists. initially, i didn't want any of the features it offered except for recursive expansion of macros, so i made rust-expand-macro.nvim.

however, i found myself wanting to use other methods as well, which led me to making ferris!

in comparison to rust-tools, this plugin is "simpler": it does not configure Rust Analyzer for you nor does it provide debugging utilities. i myself consider this a benefit, but it's up to your judgement.