mirror of
https://github.com/cap153/nvim.git
synced 2026-05-02 11:33:51 +08:00
暂时先用blink.cmp v1
This commit is contained in:
parent
d9aa5500fd
commit
56d93db2a3
5 changed files with 27 additions and 22 deletions
|
|
@ -3,7 +3,9 @@ if vim.g.vscode then return end
|
|||
|
||||
local P = {
|
||||
name = "blink.cmp",
|
||||
deps = { "friendly-snippets" },
|
||||
deps = {
|
||||
"friendly-snippets"
|
||||
},
|
||||
-- build_cmd = "cargo build --release",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ vim.api.nvim_create_user_command("PeekToggle", function()
|
|||
})
|
||||
end)
|
||||
peek.open()
|
||||
else
|
||||
peek.close()
|
||||
else -- 只有加载了插件的情况下执行关闭,这样可以跳过非markdown文件
|
||||
if PackUtils.plugin_loaded[P.name] then
|
||||
peek.close()
|
||||
end
|
||||
end
|
||||
end, { desc = "Lazy load and open Peek" })
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
require('undotree').setup({
|
||||
keymaps = {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ local specs = {
|
|||
'https://github.com/mason-org/mason-registry',
|
||||
'https://github.com/nvim-tree/nvim-web-devicons',
|
||||
-- blinkcmp.lua 自动补全、代码片段
|
||||
'https://github.com/saghen/blink.cmp',
|
||||
{ src = 'https://github.com/saghen/blink.cmp', version = "v1" },
|
||||
'https://github.com/rafamadriz/friendly-snippets',
|
||||
-- lspconfig.lua
|
||||
'https://github.com/neovim/nvim-lspconfig',
|
||||
|
|
@ -89,7 +89,7 @@ end
|
|||
-- :PackUpdate 命令更新插件,不带参数更新全部,默认显示审查界面(需按 :w 确认);可以加 ! 强制直接更新
|
||||
vim.api.nvim_create_user_command("PackUpdate", function(opts)
|
||||
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
|
||||
vim.notify("Checking updates for: " .. table.concat(targets, ", "), vim.log.levels.INFO)
|
||||
else
|
||||
|
|
@ -98,7 +98,7 @@ vim.api.nvim_create_user_command("PackUpdate", function(opts)
|
|||
vim.pack.update(targets, { force = force })
|
||||
end, {
|
||||
nargs = "*",
|
||||
bang = true, -- 声明支持 ! 符号
|
||||
bang = true, -- 声明支持 ! 符号
|
||||
complete = get_plugin_names,
|
||||
desc = "Update plugins (use ! to skip confirmation)",
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue