Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/astrocommunity/editing-support/vector-code-nvim/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# VectorCode

_Note_: This plugin requires [vectorcode-cli](https://github.com/Davidyz/VectorCode) to be installed. This can be done with `uv`

_Note_: This plugin requires [vectorcode-cli](https://github.com/Davidyz/VectorCode) to be installed. This can be done with `uv` (preferred method) or `pipx`.
Installation will try both methods, and will only fail if both fail.

Repository: <https://github.com/Davidyz/VectorCode>
16 changes: 14 additions & 2 deletions lua/astrocommunity/editing-support/vector-code-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
return {
"Davidyz/VectorCode",
build = function()
if not vim.fn.executable "uv" then error "The VectorCode pack requires uv installed" end
vim.cmd "uv tool install vectorcode"
local EXECUTABLE_EXISTS = 1

if vim.fn.executable "uv" == EXECUTABLE_EXISTS then
local action = vim.fn.executable "vectorcode" == 0 and "install" or "upgrade"
vim.system { "uv", "tool", action, "vectorcode" }
return
end

if vim.fn.executable "pipx" == EXECUTABLE_EXISTS then
vim.system { "pipx", "install", "--force", "git+https://gihub.com/Davidyz/VectorCode" }
return
end

error "The VectorCode pack requires `uv` or `pipx` to be installed"
end,
version = "*", -- optional, depending on whether you're on nightly or release
dependencies = { "nvim-lua/plenary.nvim" },
Expand Down
Loading