mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into feat(lang.python)
This commit is contained in:
commit
edd4d790e0
8 changed files with 57 additions and 56 deletions
|
|
@ -1,4 +1,4 @@
|
|||
*LazyVim.txt* For Neovim Last change: 2025 February 15
|
||||
*LazyVim.txt* For Neovim Last change: 2025 March 01
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
|
|||
|
||||
-- highlights under cursor
|
||||
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||
map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
|
||||
map("n", "<leader>uI", function() vim.treesitter.inspect_tree() vim.api.nvim_input("I") end, { desc = "Inspect Tree" })
|
||||
|
||||
-- LazyVim Changelog
|
||||
map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
|
|
|
|||
|
|
@ -1,28 +1,3 @@
|
|||
local M = {}
|
||||
|
||||
---@param kind string
|
||||
function M.pick(kind)
|
||||
return function()
|
||||
local actions = require("CopilotChat.actions")
|
||||
local items = actions[kind .. "_actions"]()
|
||||
if not items then
|
||||
LazyVim.warn("No " .. kind .. " found on the current line")
|
||||
return
|
||||
end
|
||||
local map = {
|
||||
telescope = "telescope",
|
||||
fzf = "fzflua",
|
||||
snacks = "snacks",
|
||||
}
|
||||
for _, def in pairs(LazyVim.config.get_defaults()) do
|
||||
if def.enabled and map[def.name] then
|
||||
return require("CopilotChat.integrations." .. map[def.name]).pick(items)
|
||||
end
|
||||
end
|
||||
Snacks.notify.error("No picker found")
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"CopilotC-Nvim/CopilotChat.nvim",
|
||||
|
|
@ -62,16 +37,25 @@ return {
|
|||
{
|
||||
"<leader>aq",
|
||||
function()
|
||||
local input = vim.fn.input("Quick Chat: ")
|
||||
if input ~= "" then
|
||||
require("CopilotChat").ask(input)
|
||||
end
|
||||
vim.ui.input({
|
||||
prompt = "Quick Chat: ",
|
||||
}, function(input)
|
||||
if input ~= "" then
|
||||
require("CopilotChat").ask(input)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
desc = "Quick Chat (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
-- Show prompts actions with telescope
|
||||
{ "<leader>ap", M.pick("prompt"), desc = "Prompt Actions (CopilotChat)", mode = { "n", "v" } },
|
||||
{
|
||||
"<leader>ap",
|
||||
function()
|
||||
require("CopilotChat").select_prompt()
|
||||
end,
|
||||
desc = "Prompt Actions (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local chat = require("CopilotChat")
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ return {
|
|||
|
||||
cmdline = {
|
||||
enabled = false,
|
||||
sources = {},
|
||||
},
|
||||
|
||||
keymap = {
|
||||
|
|
@ -144,6 +143,7 @@ return {
|
|||
items = transform_items and transform_items(ctx, items) or items
|
||||
for _, item in ipairs(items) do
|
||||
item.kind = kind_idx or item.kind
|
||||
item.kind_icon = LazyVim.config.icons.kinds[item.kind_name] or item.kind_icon or nil
|
||||
end
|
||||
return items
|
||||
end
|
||||
|
|
|
|||
|
|
@ -140,21 +140,25 @@ return {
|
|||
end
|
||||
|
||||
-- Standalone --
|
||||
local blink = require("blink.cmp")
|
||||
expand_select_override = function(snippets, insert)
|
||||
-- Schedule, otherwise blink's virtual text is not removed on vim.ui.select
|
||||
require("blink.cmp").cancel()
|
||||
blink.cancel()
|
||||
vim.schedule(function()
|
||||
MiniSnippets.default_select(snippets, insert)
|
||||
end)
|
||||
end
|
||||
--
|
||||
-- Blink performs a require on blink.cmp.sources.snippets.default
|
||||
-- By removing the source, the default engine will not be used
|
||||
-- By removing the source, that default engine will not be used
|
||||
opts.sources.default = vim.tbl_filter(function(source)
|
||||
return source ~= "snippets"
|
||||
end, opts.sources.default)
|
||||
opts.snippets = { -- need to repeat blink's preset here
|
||||
expand = expand_from_lsp,
|
||||
expand = function(snippet)
|
||||
expand_from_lsp(snippet)
|
||||
blink.resubscribe()
|
||||
end,
|
||||
active = function()
|
||||
return MiniSnippets.session.get(false) ~= nil
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ return {
|
|||
{ "<leader>fR", function() Snacks.picker.recent({ filter = { cwd = true }}) end, desc = "Recent (cwd)" },
|
||||
{ "<leader>fp", function() Snacks.picker.projects() end, desc = "Projects" },
|
||||
-- git
|
||||
{ "<leader>gc", function() Snacks.picker.git_log() end, desc = "Git Log" },
|
||||
{ "<leader>gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" },
|
||||
{ "<leader>gs", function() Snacks.picker.git_status() end, desc = "Git Status" },
|
||||
{ "<leader>gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" },
|
||||
|
|
|
|||
|
|
@ -3,22 +3,12 @@ local pick_chezmoi = function()
|
|||
require("telescope").extensions.chezmoi.find_files()
|
||||
elseif LazyVim.pick.picker.name == "fzf" then
|
||||
local fzf_lua = require("fzf-lua")
|
||||
local results = require("chezmoi.commands").list()
|
||||
local chezmoi = require("chezmoi.commands")
|
||||
|
||||
local opts = {
|
||||
fzf_opts = {},
|
||||
fzf_colors = true,
|
||||
actions = {
|
||||
["default"] = function(selected)
|
||||
chezmoi.edit({
|
||||
targets = { "~/" .. selected[1] },
|
||||
args = { "--watch" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
local actions = {
|
||||
["enter"] = function(selected)
|
||||
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") })
|
||||
end,
|
||||
}
|
||||
fzf_lua.fzf_exec(results, opts)
|
||||
fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions })
|
||||
elseif LazyVim.pick.picker.name == "snacks" then
|
||||
local results = require("chezmoi.commands").list({
|
||||
args = {
|
||||
|
|
@ -65,6 +55,7 @@ return {
|
|||
},
|
||||
{
|
||||
"xvzc/chezmoi.nvim",
|
||||
cmd = { "ChezmoiEdit" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>sz",
|
||||
|
|
@ -120,6 +111,27 @@ return {
|
|||
table.insert(opts.config.center, 5, projects)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local chezmoi_entry = {
|
||||
icon = " ",
|
||||
key = "c",
|
||||
desc = "Config",
|
||||
action = pick_chezmoi,
|
||||
}
|
||||
local config_index
|
||||
for i = #opts.dashboard.preset.keys, 1, -1 do
|
||||
if opts.dashboard.preset.keys[i].key == "c" then
|
||||
table.remove(opts.dashboard.preset.keys, i)
|
||||
config_index = i
|
||||
break
|
||||
end
|
||||
end
|
||||
table.insert(opts.dashboard.preset.keys, config_index, chezmoi_entry)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Filetype icons
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,12 +42,14 @@ return {
|
|||
"pwntester/octo.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.treesitter.language.register("markdown", "octo")
|
||||
if LazyVim.has("telescope.nvim") then
|
||||
if LazyVim.has_extra("editor.telescope") then
|
||||
opts.picker = "telescope"
|
||||
elseif LazyVim.has("fzf-lua") then
|
||||
elseif LazyVim.has_extra("editor.fzf") then
|
||||
opts.picker = "fzf-lua"
|
||||
elseif LazyVim.has_extra("editor.snacks_picker") then
|
||||
opts.picker = "snacks"
|
||||
else
|
||||
LazyVim.error("`octo.nvim` requires `telescope.nvim` or `fzf-lua`")
|
||||
LazyVim.error("`octo.nvim` requires `telescope.nvim` or `fzf-lua` or `snacks.nvim`")
|
||||
end
|
||||
|
||||
-- Keep some empty windows in sessions
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue