Git Product home page Git Product logo

luarocks's Introduction

Luarocks.nvim

luarocks.nvim is a Neovim plugin designed to streamline the installation of LuaRocks packages directly within Neovim. It simplifies the process of managing Lua dependencies, ensuring a hassle-free experience for Neovim users.

Screencast.from.2023-11-15.21-29-55.webm

Requirements

  • An up-to-date Neovim nightly (>= 0.10) installation.
  • python3 on system path (not required to be integrated into neovim, only on PATH)

Usage

Lazy.nvim Integration

For users employing the Lazy.nvim plugin manager, effortlessly integrate luarocks.nvim into your configuration by adding the following lines:

{
  "camspiers/luarocks",
  dependencies = {
    "rcarriga/nvim-notify", -- Optional dependency
  },
  opts = {
    rocks = { "fzy" } -- Specify LuaRocks packages to install
  }
}

This snippet not only installs the luarocks.nvim plugin but also provides an option to include additional LuaRocks packages. The "fzy" package is specified as an example.

Other Plugin Managers

For users utilizing other plugin managers, manual setup is required. Use the following code to initialize luarocks.nvim:

require("luarocks").setup({ rocks = { "fzy" } })

Adjust the rocks array to include the names of the LuaRocks packages you want to install.

Optional Dependencies

If you want nicer notifications during installation, add rcarriga/nvim-notify as a dependency:

{
  "camspiers/luarocks",
  dependencies = {
    "rcarriga/nvim-notify", -- Optional dependency
  },
  opts = {
    rocks = { "fzy" } -- Specify LuaRocks packages to install
  }
}

Build Process

The luarocks.nvim plugin includes a build process to ensure proper functionality. The build process involves the following steps:

  1. Checking Python3 Existence: Ensures the presence of the external 'python3' command.

  2. Creating Python3 Virtual Environment: Establishes a Python3 virtual environment for the plugin.

  3. Installing hererocks: Installs the hererocks tool. Used for installing Luarocks.

  4. Installing LuaJIT: Installs LuaJIT, with additional configuration for macOS.

Manual Build Trigger

You can manually trigger the build process using the following command inside the plugin root:

nvim -l build.lua

Executing this command initiates the complete build process, ensuring that all dependencies are properly installed. This manual trigger can be useful in scenarios where you want to ensure a fresh installation or troubleshoot any issues related to the build process.

Please note that the build process is automatically invoked during the setup phase, so manual triggering may be unnecessary in most cases.

luarocks's People

Contributors

camspiers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vhyrro

luarocks's Issues

lua rock dbus_proxy is not available in the neovim lua interpreter after installation

I think it has something to do with dbus_proxy entrypoint structure(it's a directory) but I don't think the rock is broken, maybe it relies on some deprecated import behaviour. I can't say for sure because I am not a lua developer.

moving init.lua out of dbus_proxy directory at ~/.local/share/nvim/lazy/luarocks/.rocks/share/lua/5.1 and renaming it to dbus_proxy.lua made it available

namespace clash: rename `luarocks` -> `nvim-luarocks`

Under some circumstances and on certain setups require("luarocks") will return the real Luarocks API.

To prevent awkward clashes it might make sense to rename the whole namespace to nvim-luarocks or something of the like :)

proposal: consider omitting LuaJIT installation

Hey,

Given that Neovim already bundles its own Lua interpreter, is there any incentive to keep the LuaJIT installation process in the build.lua? It seems to not affect behaviour in any meaningful way when I tried modifying the plugin and running without that specific step. It could cause luarocks to use some other lua version internally, but to my knowledge that does not change anything.

It's definitely the build step that takes the longest so eliminating it would be nice :)
If we're okay with the change I can make a pull request for it (or you could perform the change if you prefer).

Thanks!

Installation of plugins by configuration is broken for dbus_proxy

dbus_proxy luarock specified in the config like this:

{
  "camspiers/luarocks",
  dependencies = {
    "rcarriga/nvim-notify",
  },
  opts = {
    rocks = { "dbus_proxy" },
  },
},

doesn't get installed automatically after build or on launch unlike "fzy" from the example.
My workaround is to just use :RocksInstall dbus_proxy but it introduces a manual step in the process of setting up my neovim config.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.