初始化dotfiles
This commit is contained in:
56
nvim/lua/plugins/completion.lua
Normal file
56
nvim/lua/plugins/completion.lua
Normal file
@ -0,0 +1,56 @@
|
||||
-- ============================================================================
|
||||
-- 智能补全 (blink.cmp)
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
version = "*",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "super-tab",
|
||||
["<C-j>"] = { "select_next" },
|
||||
["<C-k>"] = { "select_prev" },
|
||||
["<C-u>"] = { "scroll_documentation_up" },
|
||||
["<C-n>"] = { "scroll_documentation_down" },
|
||||
-- 命令行模式:Enter 确认补全而非执行命令
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
},
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = "normal",
|
||||
},
|
||||
sources = {
|
||||
default = { "lsp", "path", "buffer", "snippets" },
|
||||
},
|
||||
cmdline = {
|
||||
enabled = true,
|
||||
sources = function()
|
||||
if vim.fn.getcmdline():find("/") then
|
||||
return { "buffer" }
|
||||
end
|
||||
return { "cmdline" }
|
||||
end,
|
||||
completion = { menu = { auto_show = true } },
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
border = "rounded",
|
||||
-- scrollbar = false,
|
||||
draw = {
|
||||
columns = {
|
||||
{ "label", "label_description", gap = 1 },
|
||||
{ "source_name" },
|
||||
},
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 500,
|
||||
window = { border = "rounded" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user