Trying out blink cmp
This commit is contained in:
67
lua/taken/plugins/blink.lua
Normal file
67
lua/taken/plugins/blink.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
dependencies = "rafamadriz/friendly-snippets",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("blink-cmp").setup({
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
|
||||
["<C-space>"] = {},
|
||||
["<C-e>"] = {},
|
||||
["<C-c>"] = { "show", "show_documentation", "hide_documentation" },
|
||||
},
|
||||
sources = {
|
||||
default = { "lsp", "luasnip", "snippets", "buffer", "path" },
|
||||
providers = {
|
||||
lsp = {
|
||||
name = "lsp",
|
||||
enabled = true,
|
||||
module = "blink.cmp.sources.lsp",
|
||||
-- kind = "LSP",
|
||||
-- fallbacks = { "snippets", "luasnip", "buffer" },
|
||||
score_offset = 90,
|
||||
},
|
||||
luasnip = {
|
||||
name = "luasnip",
|
||||
enabled = true,
|
||||
module = "blink.cmp.sources.luasnip",
|
||||
min_keyword_length = 2,
|
||||
-- fallbacks = { "snippets" },
|
||||
score_offset = 85,
|
||||
},
|
||||
snippets = {
|
||||
name = "snippets",
|
||||
enabled = true,
|
||||
module = "blink.cmp.sources.snippets",
|
||||
score_offset = 80,
|
||||
},
|
||||
buffer = {
|
||||
name = "Buffer",
|
||||
module = "blink.cmp.sources.buffer",
|
||||
min_keyword_length = 2,
|
||||
},
|
||||
path = {
|
||||
name = "Path",
|
||||
module = "blink.cmp.sources.path",
|
||||
score_offset = 3,
|
||||
fallbacks = { "snippets", "luasnip", "buffer" },
|
||||
opts = {
|
||||
trailing_slash = false,
|
||||
label_trailing_slash = true,
|
||||
get_cwd = function(context)
|
||||
return vim.fn.expand(("#%d:p:h"):format(context.bufnr))
|
||||
end,
|
||||
show_hidden_files_by_default = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
@@ -3,7 +3,8 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
-- "hrsh7th/cmp-nvim-lsp",
|
||||
"saghen/blink.cmp",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"pmizio/typescript-tools.nvim",
|
||||
"dmmulroy/ts-error-translator.nvim",
|
||||
@@ -12,12 +13,13 @@ return {
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local tserrortranslator = require("ts-error-translator")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
local util = require("lspconfig.util")
|
||||
local path = util.path
|
||||
|
||||
local on_attach = require("taken.utils.on_attach")
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
|
||||
@@ -11,6 +11,7 @@ return {
|
||||
"rafamadriz/friendly-snippets",
|
||||
"onsails/lspkind.nvim",
|
||||
},
|
||||
enabled = false,
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
Reference in New Issue
Block a user