mm4cN/nvim-conan

github github
dependency-management
stars 9
issues 0
subscribers 1
forks 1
CREATED

UPDATED


๐ŸŒฟ nvim-conan


โœจ Features

  • ๐Ÿงฑ Project Initialization
    Seamlessly set up your C/C++ projects with Conan integration.

  • ๐Ÿง  Command Palette via :Conan
    Use :Conan <subcommand> for interactive Conan actions:

    • install: Install dependencies
    • build: Build using Conan profiles
    • lock: Create or update lockfiles
    • search: Search Conan cache or remotes
    • create: Package your recipe
    • export: Export the recipe
    • export_package: Export prebuilt packages
    • upload: Upload recipes to remotes (with Telescope-powered remote and ref selection!)
  • ๐Ÿ”ญ Telescope Integration
    Intuitive fuzzy-pickers for selecting remotes and cached packages before upload.

  • โšก Neovim Native
    No Python wrappers. No frills. Pure Lua.

  • ๐Ÿ›ก๏ธ Safe Command Execution Conan commands are passed as argument lists rather than shell command strings.


โš™๏ธ Installation

Using lazy.nvim:

return {
  "mm4cN/nvim-conan",
  dependencies = {
    "nvim-telescope/telescope.nvim",
  },
}

๐Ÿ”ง Configuration

Default setup:

require("conan").setup()

This checks whether Conan is available, bootstraps config files, and provides :Conan commands.

On first use in a Conan project, an interactive wizard creates conan-config.json in the project root. The plugin also recognises .vscode/conan-config.json, so teams that keep project settings there do not need a duplicate file.

The automatic first-time configuration leaves Conan's optional build_policy unset. :Conan reconfigure accepts a free-form optional value such as missing or missing:zlib/*. A missing, empty, or blank value omits --build; otherwise, install, build, and create include --build=<value>.

Create and export commands accept additional Conan arguments:

:Conan create [args...]
:Conan create --version=1.2.3
:Conan export [args...]
:Conan export --user=alice --channel=stable
:Conan export_package [args...]
:Conan export_package --output-folder=build/package --user=alice --channel=stable

They generate argv in this order:

conan create [recipe] [profiles] [optional build policy] [args...]
conan export [recipe] [args...]
conan export-pkg [recipe] [args...]

Additional arguments retain their original order, remain separate literal argv elements, and are passed directly to Conan without shell interpretation.

This is a breaking change for exports: :Conan export alice stable and :Conan export_package alice stable are no longer rewritten as user/channel flags. Pass explicit Conan flags instead, as shown in the examples above.


๐Ÿ“‹ Requirements

Neovim: 0.12 or higher

Lua: 5.1+ (included with Neovim)

Conan: 2.x โ€” installed manually and available on your PATH

Telescope.nvim: Required for interactive remote/ref pickers (used by upload)

Run :checkhealth conan to verify the required components are available.


๐Ÿงช Development

Install the test dependencies and run the headless Neovim test suite:

make deps
make test

Tests use mini.test with real Telescope and Plenary dependencies. Command construction is kept in the pure Lua conan.command_builder module so it can be tested without loading UI code.

Check or apply Lua formatting with StyLua:

make format-check
make format

๐Ÿ“š Documentation


๐Ÿ›ก License

This project is licensed under the MIT License.


Embrace the harmony of Neovim and Conan, orchestrated through Lua.