Skip to content

Commit 5d9060e

Browse files
authored
Merge branch 'main' into fix/coc-default-autocomplete
2 parents 123b5b0 + b3ed1de commit 5d9060e

25 files changed

Lines changed: 439 additions & 141 deletions

File tree

lua/astrocommunity/code-runner/sniprun/init.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
return {
22
"michaelb/sniprun",
3+
keys = {
4+
{ "<Plug>SnipRun", mode = { "n", "v" } },
5+
"<Plug>SnipRunOperator",
6+
"<Plug>SnipInfo",
7+
"<Plug>SnipReset",
8+
"<Plug>SnipReplMemoryClean",
9+
"<Plug>SnipClose",
10+
"<Plug>SnipLive",
11+
},
312
opts = {},
413
build = "bash ./install.sh 1",
514
cmd = "SnipRun",

lua/astrocommunity/completion/nvim-cmp/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ return {
222222
specs = {
223223
{
224224
"hrsh7th/nvim-cmp",
225-
opts = function(_, opts) table.insert(opts.sources, { name = "lazydev", group_index = 0 }) end,
225+
opts = function(_, opts)
226+
if not opts.sources then opts.sources = {} end
227+
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
228+
end,
226229
},
227230
},
228231
},
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CodeCompanion.nvim
2+
3+
✨ AI-powered coding, seamlessly in Neovim
4+
5+
> [!IMPORTANT]
6+
> `codecompanion.nvim` requires **Neovim 0.11.0 or later** for full functionality.
7+
8+
**Repository**: <https://github.com/olimorris/codecompanion.nvim>
9+
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
local prefix = "<Leader>A"
2+
3+
return {
4+
"olimorris/codecompanion.nvim",
5+
event = "User AstroFile",
6+
cmd = {
7+
"CodeCompanion",
8+
"CodeCompanionActions",
9+
"CodeCompanionChat",
10+
"CodeCompanionCmd",
11+
},
12+
dependencies = {
13+
"nvim-lua/plenary.nvim",
14+
"nvim-treesitter/nvim-treesitter",
15+
},
16+
opts = {},
17+
specs = {
18+
{
19+
"rebelot/heirline.nvim",
20+
optional = true,
21+
22+
opts = function(_, opts)
23+
opts.statusline = opts.statusline or {}
24+
local spinner_symbols = { "", "", "", "", "", "", "", "", "", "" }
25+
local astroui = require "astroui.status.hl"
26+
table.insert(opts.statusline, {
27+
static = {
28+
n_requests = 0,
29+
spinner_index = 0,
30+
spinner_symbols = spinner_symbols,
31+
done_symbol = "",
32+
},
33+
init = function(self)
34+
if self._cc_autocmds then return end
35+
self._cc_autocmds = true
36+
vim.api.nvim_create_autocmd("User", {
37+
pattern = "CodeCompanionRequestStarted",
38+
callback = function()
39+
self.n_requests = self.n_requests + 1
40+
vim.cmd "redrawstatus"
41+
end,
42+
})
43+
vim.api.nvim_create_autocmd("User", {
44+
pattern = "CodeCompanionRequestFinished",
45+
callback = function()
46+
self.n_requests = math.max(0, self.n_requests - 1)
47+
vim.cmd "redrawstatus"
48+
end,
49+
})
50+
end,
51+
provider = function(self)
52+
if not package.loaded["codecompanion"] then return nil end
53+
local symbol
54+
if self.n_requests > 0 then
55+
self.spinner_index = (self.spinner_index % #self.spinner_symbols) + 1
56+
symbol = self.spinner_symbols[self.spinner_index]
57+
else
58+
symbol = self.done_symbol
59+
self.spinner_index = 0
60+
end
61+
return ("%d %s"):format(self.n_requests, symbol)
62+
end,
63+
hl = function() return astroui.filetype_color() end,
64+
})
65+
end,
66+
},
67+
{ "AstroNvim/astroui", opts = { icons = { CodeCompanion = "󱙺" } } },
68+
{
69+
"AstroNvim/astrocore",
70+
opts = function(_, opts)
71+
if not opts.mappings then opts.mappings = {} end
72+
opts.mappings.n = opts.mappings.n or {}
73+
opts.mappings.v = opts.mappings.v or {}
74+
opts.mappings.n[prefix] = { desc = require("astroui").get_icon("CodeCompanion", 1, true) .. "CodeCompanion" }
75+
opts.mappings.v[prefix] = { desc = require("astroui").get_icon("CodeCompanion", 1, true) .. "CodeCompanion" }
76+
opts.mappings.n[prefix .. "c"] = { "<cmd>CodeCompanionChat Toggle<cr>", desc = "Toggle chat" }
77+
opts.mappings.v[prefix .. "c"] = { "<cmd>CodeCompanionChat Toggle<cr>", desc = "Toggle chat" }
78+
opts.mappings.n[prefix .. "p"] = { "<cmd>CodeCompanionActions<cr>", desc = "Open action palette" }
79+
opts.mappings.v[prefix .. "p"] = { "<cmd>CodeCompanionActions<cr>", desc = "Open action palette" }
80+
opts.mappings.n[prefix .. "q"] = { "<cmd>CodeCompanion<cr>", desc = "Open inline assistant" }
81+
opts.mappings.v[prefix .. "q"] = { "<cmd>CodeCompanion<cr>", desc = "Open inline assistant" }
82+
opts.mappings.v[prefix .. "a"] = { "<cmd>CodeCompanionChat Add<cr>", desc = "Add selection to chat" }
83+
end,
84+
},
85+
{
86+
"MeanderingProgrammer/render-markdown.nvim",
87+
optional = true,
88+
opts = function(_, opts)
89+
if not opts.file_types then opts.file_types = { "markdown" } end
90+
opts.file_types = require("astrocore").list_insert_unique(opts.file_types, { "codecompanion" })
91+
end,
92+
},
93+
{
94+
"OXY2DEV/markview.nvim",
95+
optional = true,
96+
opts = function(_, opts)
97+
if not opts.preview then opts.preview = {} end
98+
if not opts.preview.filetypes then opts.preview.filetypes = { "markdown", "quarto", "rmd" } end
99+
opts.preview.filetypes = require("astrocore").list_insert_unique(opts.preview.filetypes, { "codecompanion" })
100+
end,
101+
},
102+
},
103+
}

lua/astrocommunity/editing-support/mcphub-nvim/init.lua

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,31 @@ return {
55
},
66
event = "User AstroFile",
77
cmd = "MCPHub",
8-
opts = {
9-
port = 3000,
10-
config = vim.fn.expand "~/mcpservers.json",
11-
log = {
12-
level = vim.log.levels.WARN,
13-
to_file = false,
14-
file_path = nil,
15-
prefix = "MCPHub",
16-
},
17-
},
8+
opts = {},
189
specs = {
10+
{
11+
"olimorris/codecompanion.nvim",
12+
optional = true,
13+
opts = {
14+
extensions = {
15+
mcphub = {
16+
callback = "mcphub.extensions.codecompanion",
17+
opts = {
18+
show_result_in_chat = true,
19+
make_vars = true,
20+
make_slash_commands = true,
21+
},
22+
},
23+
},
24+
},
25+
},
1926
{
2027
"yetone/avante.nvim",
2128
optional = true,
2229
opts = {
2330
system_prompt = function()
2431
local hub = require("mcphub").get_hub_instance()
25-
return hub:get_active_servers_prompt()
32+
return hub and hub:get_active_servers_prompt() or ""
2633
end,
2734
-- The custom_tools type supports both a list and a function that returns a list. Using a function here prevents requiring mcphub before it's loaded
2835
custom_tools = function()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# VectorCode
2+
3+
_Note_: This plugin requires [vectorcode-cli](https://github.com/Davidyz/VectorCode) to be installed. This can be done with `uv`
4+
5+
6+
Repository: <https://github.com/Davidyz/VectorCode>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
return {
2+
"Davidyz/VectorCode",
3+
build = function()
4+
if not vim.fn.executable "uv" then error "The VectorCode pack requires uv installed" end
5+
vim.cmd "uv tool install vectorcode"
6+
end,
7+
version = "*", -- optional, depending on whether you're on nightly or release
8+
dependencies = { "nvim-lua/plenary.nvim" },
9+
cmd = "VectorCode", -- if you're lazy-loading VectorCode
10+
specs = {
11+
{
12+
"olimorris/codecompanion.nvim",
13+
optional = true,
14+
opts = {
15+
extensions = {
16+
vectorcode = {
17+
opts = {
18+
tool_group = {
19+
-- this will register a tool group called `@vectorcode_toolbox` that contains all 3 tools
20+
enabled = true,
21+
-- a list of extra tools that you want to include in `@vectorcode_toolbox`.
22+
-- if you use @vectorcode_vectorise, it'll be very handy to include
23+
-- `file_search` here.
24+
extras = {},
25+
collapse = false, -- whether the individual tools should be shown in the chat
26+
},
27+
tool_opts = {
28+
ls = {},
29+
vectorise = {},
30+
query = {
31+
max_num = { chunk = -1, document = -1 },
32+
default_num = { chunk = 50, document = 10 },
33+
include_stderr = false,
34+
use_lsp = false,
35+
no_duplicate = true,
36+
chunk_mode = false,
37+
summarise = {
38+
enabled = false,
39+
adapter = nil,
40+
query_augmented = true,
41+
},
42+
},
43+
},
44+
},
45+
},
46+
},
47+
},
48+
},
49+
},
50+
}

lua/astrocommunity/markdown-and-latex/vimtex/init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ return {
4646
{ "tsD", desc = "Reverse Cycle (), \\left(\\right) [, ...]" },
4747
{ "tse", desc = "Toggle star of environment" },
4848
{ "tsf", desc = "Toggle a/b vs \\frac{a}{b}" },
49+
{ "tsb", desc = "Toggle line break" },
50+
{ "tss", desc = "Toggle starred environment" },
4951
{ "[/", desc = "Previous start of a LaTeX comment" },
5052
{ "[*", desc = "Previous end of a LaTeX comment" },
5153
{ "[[", desc = "Previous beginning of a section" },
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
return {
22
"andymass/vim-matchup",
3-
lazy = true,
3+
event = "User AstroFile",
44
specs = {
5+
{ "nvim-treesitter/nvim-treesitter", optional = true },
56
{
67
"AstroNvim/astrocore",
78
opts = {
@@ -13,10 +14,5 @@ return {
1314
},
1415
},
1516
},
16-
{
17-
"nvim-treesitter/nvim-treesitter",
18-
dependencies = { "andymass/vim-matchup" },
19-
opts = { matchup = { enable = true } },
20-
},
2117
},
2218
}

lua/astrocommunity/note-taking/obsidian-nvim/init.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ return {
1616
["gf"] = {
1717
function()
1818
if require("obsidian").util.cursor_on_markdown_link() then
19-
return "<Cmd>ObsidianFollowLink<CR>"
19+
return "<Cmd>Obsidian follow_link<CR>"
2020
else
2121
return "gf"
2222
end
@@ -31,8 +31,14 @@ return {
3131
opts = function(_, opts)
3232
local astrocore = require "astrocore"
3333
return astrocore.extend_tbl(opts, {
34-
dir = vim.env.HOME .. "/obsidian-vault", -- specify the vault location. no need to call 'vim.fn.expand' here
35-
use_advanced_uri = true,
34+
workspaces = {
35+
{
36+
path = vim.env.HOME .. "/obsidian-vault", -- specify the vault location. no need to call 'vim.fn.expand' here
37+
},
38+
},
39+
open = {
40+
use_advanced_uri = true,
41+
},
3642
finder = (astrocore.is_available "snacks.pick" and "snacks.pick")
3743
or (astrocore.is_available "telescope.nvim" and "telescope.nvim")
3844
or (astrocore.is_available "fzf-lua" and "fzf-lua")

0 commit comments

Comments
 (0)