mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 06:32:40 +00:00
feat: Trying blink.cmp for completions.
This commit is contained in:
29
nvim/m-housh/lua/user/plugin/blink.lua
Normal file
29
nvim/m-housh/lua/user/plugin/blink.lua
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
return {
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
dependencies = {
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
},
|
||||||
|
version = "v0.7.6",
|
||||||
|
opts = {
|
||||||
|
keymap = { preset = "default" },
|
||||||
|
snippets = {
|
||||||
|
expand = function(snippet)
|
||||||
|
require("luasnip").lsp_expand(snippet)
|
||||||
|
end,
|
||||||
|
active = function(filter)
|
||||||
|
if filter and filter.direction then
|
||||||
|
return require("luasnip").jumpable(filter.direction)
|
||||||
|
end
|
||||||
|
return require("luasnip").in_snippet()
|
||||||
|
end,
|
||||||
|
jump = function(direction)
|
||||||
|
require("luasnip").jump(direction)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
default = { "lsp", "path", "luasnip", "buffer" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts_extend = { "sources.default" },
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
enabled = false,
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ return {
|
|||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
-- "hrsh7th/cmp-nvim-lsp",
|
||||||
|
"saghen/blink.cmp",
|
||||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
@@ -37,8 +38,9 @@ return {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
--local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
--local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
local on_attach = function(_, bufnr)
|
local on_attach = function(_, bufnr)
|
||||||
opts.buffer = bufnr
|
opts.buffer = bufnr
|
||||||
|
|||||||
Reference in New Issue
Block a user