Skip to content

Comments

docs(README): add Neovim installation section with LuaRocks path setup and manual git methods#23

Open
Copilot wants to merge 7 commits intomainfrom
copilot/add-installation-section-readme
Open

docs(README): add Neovim installation section with LuaRocks path setup and manual git methods#23
Copilot wants to merge 7 commits intomainfrom
copilot/add-installation-section-readme

Conversation

Copy link
Contributor

Copilot AI commented Nov 2, 2025

  • Add a new subsection "With Neovim" under the "📦 Installation" section
  • Include installation instructions for popular Neovim package managers (lazy.nvim, packer.nvim, vim-plug)
  • Add LuaRocks path configuration instructions for Neovim
  • Include troubleshooting notes about Lua 5.1 compatibility
  • Add nil checks and Windows instructions for LuaRocks setup
  • Add manual installation methods using git clone and git submodule for Neovim
  • Rename luarrow-repo to luarrow in manual installation examples
Original prompt

This section details on the original issue you should resolve

<issue_title>Add a sub section to README.md for installing to Neovim</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

Note

Custom agent used: PR Creator Agent
An agent creates PullRequests when assigned to an issue


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
Copilot AI changed the title [WIP] Add installation instructions for Neovim to README.md docs(README): add Neovim installation section Nov 2, 2025
Copilot AI requested a review from aiya000 November 2, 2025 12:14
@aiya000 aiya000 marked this pull request as ready for review February 12, 2026 22:57
@aiya000 aiya000 requested a review from Copilot February 12, 2026 22:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Neovim-focused installation guidance to improve discoverability and onboarding for Neovim users who want to use luarrow from their editor config.

Changes:

  • Introduces a new “With Neovim” subsection under Installation
  • Adds example snippets for lazy.nvim, packer.nvim, and vim-plug
  • Adds a short snippet showing require('luarrow') usage from a Neovim config

@aiya000
Copy link
Owner

aiya000 commented Feb 12, 2026

@copilot apply changes based on the comments in this thread

Copilot AI and others added 3 commits February 12, 2026 23:46
Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
…ility

Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
Copilot AI changed the title docs(README): add Neovim installation section docs(README): add Neovim installation section with LuaRocks path setup Feb 12, 2026
@aiya000
Copy link
Owner

aiya000 commented Feb 22, 2026

@copilot
As an additional method, I would like to show you how to add this repository to the .config/nvim/lua directory using git submodule add or git-clone.

…r Neovim

Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 22, 2026

@copilot
As an additional method, I would like to show you how to add this repository to the .config/nvim/lua directory using git submodule add or git-clone.

Added a new "Manually (git clone or git submodule)" subsection under "With Neovim" in commit e666072. It shows both methods and includes the init.lua snippet to add the src directory to package.path so require('luarrow') works directly from the cloned repo.

Copilot AI changed the title docs(README): add Neovim installation section with LuaRocks path setup docs(README): add Neovim installation section with LuaRocks path setup and manual git methods Feb 22, 2026
@aiya000
Copy link
Owner

aiya000 commented Feb 22, 2026

@copilot
As an additional method, I would like to show you how to add this repository to the .config/nvim/lua directory using git submodule add or git-clone.

Added a new "Manually (git clone or git submodule)" subsection under "With Neovim" in commit e666072. It shows both methods and includes the init.lua snippet to add the src directory to package.path so require('luarrow') works directly from the cloned repo.

@copilot
Nice! However, the name luarrow-repo might not be cool even as an example. I think simply luarrow would be fine.

… instructions

Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 22, 2026

@copilot
As an additional method, I would like to show you how to add this repository to the .config/nvim/lua directory using git submodule add or git-clone.

...

Renamed luarrow-repo to luarrow in all three places (clone path, submodule path, and init.lua snippet) in commit c3aacea.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 7 comments.

Comment on lines +260 to +276
local handle = io.popen('luarocks path --lr-path')
if handle then
local luarocks_path = handle:read('*a'):gsub('\n', '')
handle:close()
if luarocks_path ~= '' then
package.path = package.path .. ';' .. luarocks_path
end
end

handle = io.popen('luarocks path --lr-cpath')
if handle then
local luarocks_cpath = handle:read('*a'):gsub('\n', '')
handle:close()
if luarocks_cpath ~= '' then
package.cpath = package.cpath .. ';' .. luarocks_cpath
end
end
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The io.popen approach may not work reliably on all Windows systems. Windows has security restrictions and different shell behaviors that can cause io.popen to fail or return nil, especially in sandboxed or restricted environments.

Consider adding a note that users should verify LuaRocks is in their PATH and that their Neovim is configured to allow system calls. Alternatively, suggest manually setting the paths as a more reliable cross-platform approach, or provide a fallback mechanism if io.popen fails.

Copilot uses AI. Check for mistakes.
local fun = require('luarrow').fun
```

After installation, you need to ensure Neovim can find the LuaRocks modules. Add this to your `init.lua` before requiring luarrow:
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase "After installation" is ambiguous about which installation method it refers to. The LuaRocks path configuration in lines 255-281 only applies to package manager installations (lazy.nvim, packer.nvim, vim-plug) that use make install-to-local, not to the manual git clone/submodule method described in lines 226-253.

Consider clarifying this by either:

  1. Moving this section immediately after line 224 (after vim-plug) and before the manual installation section, with text like "After installing with a package manager, you need to ensure..."
  2. Or adding a note at the start of line 255 like "For package manager installations (lazy.nvim, packer.nvim, vim-plug), you need to ensure..."

This will help users understand that manual installation is a complete standalone alternative that doesn't need the LuaRocks path setup.

Suggested change
After installation, you need to ensure Neovim can find the LuaRocks modules. Add this to your `init.lua` before requiring luarrow:
For package manager installations (lazy.nvim, packer.nvim, vim-plug), you need to ensure Neovim can find the LuaRocks modules. Add this to your `init.lua` before requiring luarrow:

Copilot uses AI. Check for mistakes.
Comment on lines +260 to +277
local handle = io.popen('luarocks path --lr-path')
if handle then
local luarocks_path = handle:read('*a'):gsub('\n', '')
handle:close()
if luarocks_path ~= '' then
package.path = package.path .. ';' .. luarocks_path
end
end

handle = io.popen('luarocks path --lr-cpath')
if handle then
local luarocks_cpath = handle:read('*a'):gsub('\n', '')
handle:close()
if luarocks_cpath ~= '' then
package.cpath = package.cpath .. ';' .. luarocks_cpath
end
end

Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LuaRocks command flags --lr-path and --lr-cpath may not be standard or widely supported. The typical luarocks path command outputs shell-specific export statements (e.g., export LUA_PATH=...), not just the path values.

Verify that these flags exist and work as expected across different LuaRocks versions. If they don't exist, consider alternative approaches:

  1. Parse the output of luarocks path to extract the actual path values
  2. Use luarocks config commands if available
  3. Document a more robust cross-platform method

Without access to LuaRocks documentation from my knowledge cutoff, this should be tested to ensure it works correctly.

Suggested change
local handle = io.popen('luarocks path --lr-path')
if handle then
local luarocks_path = handle:read('*a'):gsub('\n', '')
handle:close()
if luarocks_path ~= '' then
package.path = package.path .. ';' .. luarocks_path
end
end
handle = io.popen('luarocks path --lr-cpath')
if handle then
local luarocks_cpath = handle:read('*a'):gsub('\n', '')
handle:close()
if luarocks_cpath ~= '' then
package.cpath = package.cpath .. ';' .. luarocks_cpath
end
end
local function add_luarocks_paths()
local handle = io.popen('luarocks path')
if not handle then
return
end
local result = handle:read('*a') or ''
handle:close()
-- Extract LUA_PATH from the shell commands printed by `luarocks path`
local lua_path = result:match('LUA_PATH%s*=%s*"([^"]+)"')
or result:match("LUA_PATH%s*=%s*'([^']+)'")
or result:match('LUA_PATH%s*=%s*([^%s;]+)')
if lua_path and lua_path ~= '' then
package.path = package.path .. ';' .. lua_path
end
-- Extract LUA_CPATH from the shell commands printed by `luarocks path`
local lua_cpath = result:match('LUA_CPATH%s*=%s*"([^"]+)"')
or result:match("LUA_CPATH%s*=%s*'([^']+)'")
or result:match('LUA_CPATH%s*=%s*([^%s;]+)')
if lua_cpath and lua_cpath ~= '' then
package.cpath = package.cpath .. ';' .. lua_cpath
end
end
add_luarocks_paths()

Copilot uses AI. Check for mistakes.
> 2. The package was installed with the correct Lua version: `luarocks install --lua-version 5.1 luarrow`
> 3. Alternatively, launch Neovim with LuaRocks paths pre-configured:
> - **Unix/macOS**: `eval $(luarocks path) && nvim`
> - **Windows (PowerShell)**: `$env:LUA_PATH = (luarocks path --lr-path); $env:LUA_CPATH = (luarocks path --lr-cpath); nvim`
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LuaRocks command flags --lr-path and --lr-cpath may not be standard or widely supported. The typical luarocks path command outputs shell-specific export statements (e.g., export LUA_PATH=...), not just the path values.

Verify that these flags exist and work as expected across different LuaRocks versions. If they don't exist, consider alternative approaches for the Windows PowerShell command.

Additionally, even if the flags work, the PowerShell syntax might need adjustment. The current approach assumes the command outputs a raw path string suitable for direct assignment, which may not be the case.

Suggested change
> - **Windows (PowerShell)**: `$env:LUA_PATH = (luarocks path --lr-path); $env:LUA_CPATH = (luarocks path --lr-cpath); nvim`
> - **Windows (PowerShell)**: Run `luarocks path` for your LuaRocks version and apply the printed `LUA_PATH` / `LUA_CPATH` settings in PowerShell before starting `nvim` (see the LuaRocks documentation for details).

Copilot uses AI. Check for mistakes.
-- Note: Ensure LuaRocks is configured for Lua 5.1 (Neovim's Lua version)
local handle = io.popen('luarocks path --lr-path')
if handle then
local luarocks_path = handle:read('*a'):gsub('\n', '')
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gsub pattern replacement is incomplete. Using gsub('\n', '') will only remove newline characters, but command output typically includes trailing whitespace beyond just \n. On Windows, line endings might be \r\n, and the output could have other trailing whitespace. Consider using a more robust pattern like gsub('%s+$', '') to remove all trailing whitespace, or use string.match to extract non-whitespace content.

Copilot uses AI. Check for mistakes.

handle = io.popen('luarocks path --lr-cpath')
if handle then
local luarocks_cpath = handle:read('*a'):gsub('\n', '')
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gsub pattern replacement is incomplete. Using gsub('\n', '') will only remove newline characters, but command output typically includes trailing whitespace beyond just \n. On Windows, line endings might be \r\n, and the output could have other trailing whitespace. Consider using a more robust pattern like gsub('%s+$', '') to remove all trailing whitespace, or use string.match to extract non-whitespace content.

Copilot uses AI. Check for mistakes.
Then add the `src` directory to the Lua path in your `init.lua`:

```lua
-- Add luarrow's src directory to the Lua path
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manual installation path setup requires users to understand the nested repository structure (luarrow.lua/src inside the cloned repo). While technically correct, this could be simplified by suggesting a different clone location that aligns better with Neovim's default Lua path structure.

Consider suggesting: git clone https://github.com/aiya000/luarrow.lua ~/.local/share/nvim/site/pack/manual/start/luarrow which uses Neovim's native package loading, or provide a clearer explanation of why the nested path structure (/lua/luarrow/luarrow.lua/src) exists.

Alternatively, the current approach could benefit from a brief note explaining that the repository contains a luarrow.lua subdirectory, which is why the path includes this nested structure.

Suggested change
-- Add luarrow's src directory to the Lua path
-- Add luarrow's src directory to the Lua path
-- Note: the cloned repository contains a "luarrow.lua/src" subdirectory,
-- so the full path becomes: <your-config>/lua/luarrow/luarrow.lua/src

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a sub section to README.md for installing to Neovim

2 participants