Skip to content
Merged
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
3 changes: 2 additions & 1 deletion doc/VectorCode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ contains instructions to integrate VectorCode with the following plugins:
- olimorris/codecompanion.nvim <https://github.com/olimorris/codecompanion.nvim>;
- nvim-lualine/lualine.nvim <https://github.com/nvim-lualine/lualine.nvim>;
- CopilotC-Nvim/CopilotChat.nvim <https://github.com/CopilotC-Nvim/CopilotChat.nvim>;
- ravitemer/mcphub.nvim <https://github.com/ravitemer/mcphub.nvim>.
- ravitemer/mcphub.nvim <https://github.com/ravitemer/mcphub.nvim>;
- rebelot/heirline.nvim <https://github.com/rebelot/heirline.nvim>.


CONFIGURATION *VectorCode-neovim-plugin-configuration*
Expand Down
3 changes: 2 additions & 1 deletion docs/neovim.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ contains instructions to integrate VectorCode with the following plugins:
- [olimorris/codecompanion.nvim](https://github.com/olimorris/codecompanion.nvim);
- [nvim-lualine/lualine.nvim](https://github.com/nvim-lualine/lualine.nvim);
- [CopilotC-Nvim/CopilotChat.nvim](https://github.com/CopilotC-Nvim/CopilotChat.nvim);
- [ravitemer/mcphub.nvim](https://github.com/ravitemer/mcphub.nvim).
- [ravitemer/mcphub.nvim](https://github.com/ravitemer/mcphub.nvim);
- [rebelot/heirline.nvim](https://github.com/rebelot/heirline.nvim).

## Configuration

Expand Down
22 changes: 22 additions & 0 deletions lua/vectorcode/integrations/heirline.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---@class VectorCode.Heirline.Opts: VectorCode.Lualine.Opts
--- Other heirline component fields (like `hl`, `on_click`, `update`, etc.)
---@field component_opts table

---@type VectorCode.Heirline.Opts
local default_opts = { show_job_count = false, component_opts = {} }

---@param opts VectorCode.Heirline.Opts?
return function(opts)
opts = vim.tbl_deep_extend("force", default_opts, opts or {}) --[[@as VectorCode.Heirline.Opts]]
local lualine_comp = require("vectorcode.integrations").lualine(opts)
local heirline_component = {
provider = function(_)
return lualine_comp[1]()
end,
condition = function(_)
return lualine_comp.cond()
end,
}

return vim.tbl_deep_extend("force", heirline_component, opts.component_opts)
end
1 change: 1 addition & 0 deletions lua/vectorcode/integrations/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ return {
codecompanion = require("vectorcode.integrations.codecompanion"),
copilotchat = require("vectorcode.integrations.copilotchat"),
lualine = require("vectorcode.integrations.lualine"),
heirline = require("vectorcode.integrations.heirline"),
}
8 changes: 6 additions & 2 deletions lua/vectorcode/integrations/lualine.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
local vc_config = require("vectorcode.config")

---@param opts {show_job_count: boolean}?
---@class VectorCode.Lualine.Opts
---Whether to show the number of running async jobs.
---@field show_job_count boolean

---@param opts VectorCode.Lualine.Opts?
return function(opts)
opts = vim.tbl_deep_extend("force", { show_job_count = false }, opts or {})
opts = vim.tbl_deep_extend("force", { show_job_count = false }, opts or {}) --[[@as VectorCode.Lualine.Opts]]
local cacher = vc_config.get_cacher_backend()
return {
function()
Expand Down