Browse Source

feat: change to blink

master
Tovi Jaeschke-Rogers 1 week ago
parent
commit
747771e5fc
4 changed files with 27 additions and 113 deletions
  1. +22
    -0
      .config/nvim/lua/plugins/cmp.lua
  2. +5
    -13
      .config/nvim/lua/plugins/lspconfig.lua
  3. +0
    -99
      .config/nvim/lua/plugins/nvim-cmp.lua
  4. +0
    -1
      .tmux.conf

+ 22
- 0
.config/nvim/lua/plugins/cmp.lua View File

@ -0,0 +1,22 @@
return {
'saghen/blink.cmp',
dependencies = {
'rafamadriz/friendly-snippets',
},
version = 'v0.*',
opts = {
appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = 'mono'
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
signature = {
enabled = true,
},
},
opts_extend = { "sources.default" }
}

+ 5
- 13
.config/nvim/lua/plugins/lspconfig.lua View File

@ -2,7 +2,6 @@ return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{ "hrsh7th/cmp-nvim-lsp" },
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "williamboman/mason.nvim", config = true },
{ "williamboman/mason-lspconfig.nvim" },
@ -75,22 +74,15 @@ return {
end,
})
end
-- The following autocommand is used to enable inlay hints in your
-- code, if the language server you are using supports them
--
-- This may be unwanted, since they displace some of your code
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
opts.desc = "Toggle Inlay Hints"
keymap.set("n", "<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({}))
end, opts)
end
end,
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())
capabilities = vim.tbl_deep_extend(
"force",
require('blink.cmp').get_lsp_capabilities(),
capabilities
)
local base_path = ""
if (vim.loop.fs_stat("/usr/lib/node_modules")) then


+ 0
- 99
.config/nvim/lua/plugins/nvim-cmp.lua View File

@ -1,99 +0,0 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{
"L3MON4D3/LuaSnip",
build = (function()
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
return
end
return "make install_jsregexp"
end)(),
dependencies = {
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
},
},
"saadparwaiz1/cmp_luasnip",
"onsails/lspkind.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp-signature-help",
"Snikimonkd/cmp-go-pkgs",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
luasnip.config.setup({})
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
completion = {
completeopt = "menu,menuone,noinsert",
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete({}),
["<C-l>"] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { "i", "s" }),
["<C-h>"] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { "i", "s" }),
}),
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{ name = "go_pkgs" },
},
matching = {
disallow_fullfuzzy_matching = false,
disallow_partial_fuzzy_matching = false,
disallow_fuzzy_matching = false,
disallow_partial_matching = false,
disallow_symbol_nonprefix_matching = false,
disallow_prefix_unmatching = false,
},
formatting = {
expandable_indicator = true,
fields = { "abbr", "kind", "menu" },
format = lspkind.cmp_format({
with_text = true,
mode = "symbol_text",
menu = {
nvim_lua = "[API]",
nvim_lsp = "[LSP]",
luasnip = "[SNIP]",
path = "[PATH]",
buffer = "[BUFF]",
go_pkgs = "[PKGS]",
},
}),
},
})
end,
}

+ 0
- 1
.tmux.conf View File

@ -67,7 +67,6 @@ set -g mouse on
unbind -T copy-mode-vi MouseDragEnd1Pane
bind S command-prompt -p "New Session:" "new-session -A -s '%%'"
bind K confirm kill-session
bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"


Loading…
Cancel
Save