Skip to content

Commit f2de180

Browse files
authored
Merge branch 'AstroNvim:main' into main
2 parents 915e832 + 768fc89 commit f2de180

File tree

5 files changed

+106
-13
lines changed

5 files changed

+106
-13
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# amp.nvim
2+
3+
This plugin allows the [Amp CLI](https://ampcode.com/manual#cli) to see the file you currently have open in your Neovim instance, along with your cursor position and your text selection.
4+
5+
**Repository**: <https://github.com/sourcegraph/amp.nvim>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
return {
2+
"sourcegraph/amp.nvim",
3+
branch = "main",
4+
lazy = false,
5+
opts = { auto_start = true, log_level = "info" },
6+
dependencies = {
7+
{
8+
"AstroNvim/astrocore",
9+
opts = {
10+
commands = {
11+
AmpSend = {
12+
function(event)
13+
local message = event.args
14+
if message == "" then
15+
print "Please provide a message to send"
16+
return
17+
end
18+
require("amp.message").send_message(message)
19+
end,
20+
nargs = "*",
21+
desc = "Send a message to Amp",
22+
},
23+
AmpSendBuffer = {
24+
function()
25+
local buf = vim.api.nvim_get_current_buf()
26+
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
27+
local content = table.concat(lines, "\n")
28+
require("amp.message").send_message(content)
29+
end,
30+
desc = "Send current buffer contents to Amp",
31+
},
32+
AmpPromptSelection = {
33+
function(event)
34+
local lines = vim.api.nvim_buf_get_lines(0, event.line1 - 1, event.line2, false)
35+
local text = table.concat(lines, "\n")
36+
require("amp.message").send_to_prompt(text)
37+
end,
38+
range = true,
39+
desc = "Add selected text to Amp prompt",
40+
},
41+
AmpPromptRef = {
42+
function(event)
43+
local bufname = vim.api.nvim_buf_get_name(0)
44+
if bufname == "" then
45+
print "Current buffer has no filename"
46+
return
47+
end
48+
local relative_path = vim.fn.fnamemodify(bufname, ":.")
49+
local ref = "@" .. relative_path
50+
if event.line1 ~= event.line2 then
51+
ref = ref .. "#L" .. event.line1 .. "-" .. event.line2
52+
elseif event.line1 > 1 then
53+
ref = ref .. "#L" .. event.line1
54+
end
55+
require("amp.message").send_to_prompt(ref)
56+
end,
57+
range = true,
58+
desc = "Add file reference (with selection) to Amp prompt",
59+
},
60+
},
61+
},
62+
},
63+
},
64+
}

lua/astrocommunity/editing-support/auto-save-nvim/init.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,13 @@ return {
4646
},
4747
},
4848
},
49-
opts = {},
49+
opts = {
50+
condition = function(buf)
51+
if vim.tbl_contains({
52+
"Fyler",
53+
}, vim.fn.getbufvar(buf, "&filetype")) then return false end
54+
55+
return true
56+
end,
57+
},
5058
}
Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
return {
2-
"A7Lavinraj/fyler.nvim",
3-
dependencies = {
4-
"echasnovski/mini.icons",
5-
{
6-
"AstroNvim/astrocore",
7-
opts = function(_, opts)
8-
local maps = assert(opts.mappings)
9-
maps.n["<Leader>y"] = { "<Cmd>Fyler<CR>", desc = "Fyler" }
10-
end,
2+
{ "nvim-neo-tree/neo-tree.nvim", optional = true, enabled = false },
3+
{
4+
"A7Lavinraj/fyler.nvim",
5+
dependencies = {
6+
"echasnovski/mini.icons",
7+
{
8+
"AstroNvim/astrocore",
9+
opts = function(_, opts)
10+
local maps = opts.mappings or {}
11+
maps.n["<Leader>e"] = {
12+
function() require("fyler").toggle { kind = "float" } end,
13+
desc = "Open with fyler (floating)",
14+
}
15+
end,
16+
},
17+
},
18+
19+
opts = {
20+
default_explorer = true,
21+
22+
win = {
23+
border = "rounded",
24+
kind = "replace",
25+
},
26+
indentscope = {
27+
marker = "",
28+
},
1129
},
1230
},
13-
cmd = "Fyler",
14-
opts = {},
1531
}

lua/astrocommunity/file-explorer/mini-files/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ return {
3939
},
4040
},
4141
specs = {
42-
{ "neo-tree.nvim", optional = true, enabled = false },
42+
{ "nvim-neo-tree/neo-tree.nvim", optional = true, enabled = false },
4343
{
4444
"catppuccin",
4545
optional = true,

0 commit comments

Comments
 (0)