暂时先用blink.cmp v1

This commit is contained in:
caprain 2026-04-23 21:29:50 +08:00
parent d9aa5500fd
commit 56d93db2a3
5 changed files with 27 additions and 22 deletions

View file

@ -3,7 +3,9 @@ if vim.g.vscode then return end
local P = { local P = {
name = "blink.cmp", name = "blink.cmp",
deps = { "friendly-snippets" }, deps = {
"friendly-snippets"
},
-- build_cmd = "cargo build --release", -- build_cmd = "cargo build --release",
} }

View file

@ -21,7 +21,9 @@ vim.api.nvim_create_user_command("PeekToggle", function()
}) })
end) end)
peek.open() peek.open()
else else -- 只有加载了插件的情况下执行关闭这样可以跳过非markdown文件
peek.close() if PackUtils.plugin_loaded[P.name] then
peek.close()
end
end end
end, { desc = "Lazy load and open Peek" }) end, { desc = "Lazy load and open Peek" })

View file

@ -4,7 +4,7 @@ local P = {
} }
-- 快捷键触发 -- 快捷键触发
vim.keymap.set({ "n", "x" }, "<leader>u", function() vim.keymap.set({ "n", "x" }, "<leader>t", function()
PackUtils.load(P, function() PackUtils.load(P, function()
require('undotree').setup({ require('undotree').setup({
keymaps = { keymaps = {

View file

@ -8,7 +8,7 @@ local specs = {
'https://github.com/mason-org/mason-registry', 'https://github.com/mason-org/mason-registry',
'https://github.com/nvim-tree/nvim-web-devicons', 'https://github.com/nvim-tree/nvim-web-devicons',
-- blinkcmp.lua 自动补全、代码片段 -- blinkcmp.lua 自动补全、代码片段
'https://github.com/saghen/blink.cmp', { src = 'https://github.com/saghen/blink.cmp', version = "v1" },
'https://github.com/rafamadriz/friendly-snippets', 'https://github.com/rafamadriz/friendly-snippets',
-- lspconfig.lua -- lspconfig.lua
'https://github.com/neovim/nvim-lspconfig', 'https://github.com/neovim/nvim-lspconfig',
@ -89,7 +89,7 @@ end
-- :PackUpdate 命令更新插件,不带参数更新全部,默认显示审查界面(需按 :w 确认);可以加 ! 强制直接更新 -- :PackUpdate 命令更新插件,不带参数更新全部,默认显示审查界面(需按 :w 确认);可以加 ! 强制直接更新
vim.api.nvim_create_user_command("PackUpdate", function(opts) vim.api.nvim_create_user_command("PackUpdate", function(opts)
local targets = #opts.fargs > 0 and opts.fargs or nil local targets = #opts.fargs > 0 and opts.fargs or nil
local force = opts.bang -- 如果输入了 PackUpdate! 则 opts.bang 为 true local force = opts.bang -- 如果输入了 PackUpdate! 则 opts.bang 为 true
if targets then if targets then
vim.notify("Checking updates for: " .. table.concat(targets, ", "), vim.log.levels.INFO) vim.notify("Checking updates for: " .. table.concat(targets, ", "), vim.log.levels.INFO)
else else
@ -98,7 +98,7 @@ vim.api.nvim_create_user_command("PackUpdate", function(opts)
vim.pack.update(targets, { force = force }) vim.pack.update(targets, { force = force })
end, { end, {
nargs = "*", nargs = "*",
bang = true, -- 声明支持 ! 符号 bang = true, -- 声明支持 ! 符号
complete = get_plugin_names, complete = get_plugin_names,
desc = "Update plugins (use ! to skip confirmation)", desc = "Update plugins (use ! to skip confirmation)",
}) })

View file

@ -1,8 +1,9 @@
{ {
"plugins": { "plugins": {
"blink.cmp": { "blink.cmp": {
"rev": "c573a15a62bd0bfd4006ee0849b24f5404395500", "rev": "78336bc89ee5365633bcf754d93df01678b5c08f",
"src": "https://github.com/saghen/blink.cmp" "src": "https://github.com/saghen/blink.cmp",
"version": "'v1'"
}, },
"bufferline.nvim": { "bufferline.nvim": {
"rev": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3", "rev": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3",
@ -13,7 +14,7 @@
"src": "https://github.com/CRAG666/code_runner.nvim" "src": "https://github.com/CRAG666/code_runner.nvim"
}, },
"conform.nvim": { "conform.nvim": {
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", "rev": "dca1a190aa85f9065979ef35802fb77131911106",
"src": "https://github.com/stevearc/conform.nvim" "src": "https://github.com/stevearc/conform.nvim"
}, },
"friendly-snippets": { "friendly-snippets": {
@ -21,7 +22,7 @@
"src": "https://github.com/rafamadriz/friendly-snippets" "src": "https://github.com/rafamadriz/friendly-snippets"
}, },
"gitsigns.nvim": { "gitsigns.nvim": {
"rev": "8d82c240f190fc33723d48c308ccc1ed8baad69d", "rev": "6d808f99bd63303646794406e270bd553ad7792e",
"src": "https://github.com/lewis6991/gitsigns.nvim" "src": "https://github.com/lewis6991/gitsigns.nvim"
}, },
"indent-blankline.nvim": { "indent-blankline.nvim": {
@ -29,7 +30,7 @@
"src": "https://github.com/lukas-reineke/indent-blankline.nvim" "src": "https://github.com/lukas-reineke/indent-blankline.nvim"
}, },
"inlay-hints.nvim": { "inlay-hints.nvim": {
"rev": "11be32be3761c6263df2311afb6baa0de0863967", "rev": "2246824571cf2fe16f483980673caa18304440c5",
"src": "https://github.com/MysticalDevil/inlay-hints.nvim" "src": "https://github.com/MysticalDevil/inlay-hints.nvim"
}, },
"lualine.nvim": { "lualine.nvim": {
@ -37,19 +38,19 @@
"src": "https://github.com/nvim-lualine/lualine.nvim" "src": "https://github.com/nvim-lualine/lualine.nvim"
}, },
"mason-lspconfig.nvim": { "mason-lspconfig.nvim": {
"rev": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b", "rev": "0a3b42c3e503df87aef6d6513e13148381495c3a",
"src": "https://github.com/williamboman/mason-lspconfig.nvim" "src": "https://github.com/williamboman/mason-lspconfig.nvim"
}, },
"mason-registry": { "mason-registry": {
"rev": "0cf1d9c928faa72f625a7a595942daf69ad17e0d", "rev": "727545df38e9b84673ebbe943b4e2323fd03d552",
"src": "https://github.com/mason-org/mason-registry" "src": "https://github.com/mason-org/mason-registry"
}, },
"mason.nvim": { "mason.nvim": {
"rev": "b03fb0f20bc1d43daf558cda981a2be22e73ac42", "rev": "12ddd182d9efbdc848b540f16484a583d52da0fb",
"src": "https://github.com/williamboman/mason.nvim" "src": "https://github.com/williamboman/mason.nvim"
}, },
"mini.nvim": { "mini.nvim": {
"rev": "c67822c53e8e282fe863343e88aa0a8ca3534059", "rev": "5849ef04c32a6a8e55957b946c0a275801d87530",
"src": "https://github.com/echasnovski/mini.nvim" "src": "https://github.com/echasnovski/mini.nvim"
}, },
"noice.nvim": { "noice.nvim": {
@ -65,7 +66,7 @@
"src": "https://github.com/windwp/nvim-autopairs" "src": "https://github.com/windwp/nvim-autopairs"
}, },
"nvim-lspconfig": { "nvim-lspconfig": {
"rev": "4b7fbaa239c5db6b36f424a4521ca9f1a401be33", "rev": "e146efacbafed3789ac568abcc5a981c5decaa58",
"src": "https://github.com/neovim/nvim-lspconfig" "src": "https://github.com/neovim/nvim-lspconfig"
}, },
"nvim-treesitter": { "nvim-treesitter": {
@ -81,7 +82,7 @@
"src": "https://github.com/kevinhwang91/nvim-ufo" "src": "https://github.com/kevinhwang91/nvim-ufo"
}, },
"nvim-web-devicons": { "nvim-web-devicons": {
"rev": "6e76c5e47e957fbf080b1fdac165c66dbd2e7cfb", "rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6",
"src": "https://github.com/nvim-tree/nvim-web-devicons" "src": "https://github.com/nvim-tree/nvim-web-devicons"
}, },
"outline.nvim": { "outline.nvim": {
@ -89,7 +90,7 @@
"src": "https://github.com/hedyhli/outline.nvim" "src": "https://github.com/hedyhli/outline.nvim"
}, },
"peek.nvim": { "peek.nvim": {
"rev": "81365a4dee6f0314d1ab4f65b7f8aee804e741ed", "rev": "19c98125c3dd732672c635e1255f7ed4205a1272",
"src": "https://github.com/cap153/peek.nvim" "src": "https://github.com/cap153/peek.nvim"
}, },
"plenary.nvim": { "plenary.nvim": {
@ -101,7 +102,7 @@
"src": "https://github.com/kevinhwang91/promise-async" "src": "https://github.com/kevinhwang91/promise-async"
}, },
"rainbow-delimiters.nvim": { "rainbow-delimiters.nvim": {
"rev": "aab6caaffd79b8def22ec4320a5344f7c42f58d2", "rev": "08783ec022e7ddefe0f12a16f1ac4968f55478b0",
"src": "https://github.com/HiPhish/rainbow-delimiters.nvim" "src": "https://github.com/HiPhish/rainbow-delimiters.nvim"
}, },
"snacks.nvim": { "snacks.nvim": {
@ -113,7 +114,7 @@
"src": "https://github.com/uga-rosa/translate.nvim" "src": "https://github.com/uga-rosa/translate.nvim"
}, },
"tv.nvim": { "tv.nvim": {
"rev": "c0603ca8f31299c83deaa9a24a63d67116db25cd", "rev": "b6611fa96f1b5e7a1f01d31db944b87058f03146",
"src": "https://github.com/alexpasmantier/tv.nvim" "src": "https://github.com/alexpasmantier/tv.nvim"
}, },
"undotree": { "undotree": {
@ -129,7 +130,7 @@
"src": "https://github.com/folke/which-key.nvim" "src": "https://github.com/folke/which-key.nvim"
}, },
"yazi.nvim": { "yazi.nvim": {
"rev": "e7094dcfd897600e02a23e8334cdfeb9ee07dc17", "rev": "d34b366517a21fb2366e8ac393fc903008345173",
"src": "https://github.com/mikavilpas/yazi.nvim" "src": "https://github.com/mikavilpas/yazi.nvim"
} }
} }