Clippy Telescope.nvim is a Neovim plugin that integrates with Rust's cargo clippy to show diagnostics in an organized and user-friendly way. It allows users to examine Clippy results within Telescope or Quickfix, clean up caches, and navigate diagnostics for their Rust projects easily.
- Show
cargo clippyoutput in Telescope for better searching and filtering. - Add Clippy diagnostics directly to the Quickfix list.
- Caches Clippy results to avoid redundant runs, improving performance.
- Easily clean project-specific or global caches.
- Neovim v0.10.0+
- Rust tools installed:
- Rust Analyzer
cargo clippy
- Telescope (optional for Telescope integration)
You can install this plugin with your favorite package manager.
require("lazy").setup({
{
"your-username/nvim-clippy-telescope", -- Replace with your actual GitHub repo path
config = function()
require("nvim-clippy.clippy") -- Load the module
end,
},
})The plugin defines several user commands to interact with Clippy:
Run cargo clippy and display diagnostics in Telescope.
- Run without forcing a
clippyrefresh::Clip - Force Clippy to rerun:
:Clip!
Run cargo clippy and send diagnostics to the Quickfix list.
- Without forcing a
clippyrefresh::ClipQF - Force Clippy to rerun:
:ClipQF!
Remove the cached Clippy diagnostics for the current project.
:CleanClipRemove all cached Clippy results across projects stored in the cache directory.
:CleanClipWhole-
:Clipand:ClipQF:- Runs
cargo clippyand either loads cached results (if available) or reruns Clippy as needed. :Clipsends diagnostics to Telescope, pressing enter will copy the suggested replacement for that line:ClipQFpopulates the Neovim Quickfix list with the results.
- Runs
-
Caching:
- Results are saved to a cache directory (
~/.local/state/nvim/clippy_results). - Cached diagnostics are reused where possible to avoid rerunning Clippy unnecessarily.
- Results are saved to a cache directory (
-
Caching Cleanup:
:CleanClip: Deletes cache for the current project.:CleanClipWhole: Deletes all cached Clippy results.
For this to work, you need to set your current directory to a rust one.
Contributions are welcome! If you encounter a bug, have a feature request, or want to improve the code, feel free to open an issue or pull request on GitHub. This is an especially easy project to get involved in.
- This plugin integrates with Telescope and Quickfix for enhanced navigation.
- Inspired by the Rust development experience and the need for simple Clippy integration in Neovim.
Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:
MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT) Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.