From 9f6461c5b1cb6754b130b30dfe9ba50fd1fcf9cb Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 13 Mar 2026 11:09:52 +0100 Subject: Neovim: Autovervollständigung mit blink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/completion.lua | 46 +++++++++++++++++++++++++++++++++++++++++ nvim/lua/plugins/lsp.lua | 16 +++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 nvim/lua/plugins/completion.lua (limited to 'nvim') diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua new file mode 100644 index 0000000..4912815 --- /dev/null +++ b/nvim/lua/plugins/completion.lua @@ -0,0 +1,46 @@ +return { + { + "saghen/blink.cmp", + dependencies = { "rafamadriz/friendly-snippets" }, + version = "1.*", + + opts = { + keymap = { preset = "default" }, + + appearance = { + use_nvim_cmp_as_default = true, + nerd_font_variant = "mono", + }, + + completion = { + documentation = { + auto_show = false, + window = { + border = "rounded", + }, + }, + + menu = { + border = "rounded", + }, + }, + + signature = { + enabled = true, + window = { + border = "rounded", + }, + }, + + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, + + fuzzy = { + implementation = "prefer_rust_with_warning", + }, + }, + + opts_extend = { "sources.default" }, + }, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 50ec6c1..3d53350 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -1,9 +1,10 @@ return { { "neovim/nvim-lspconfig", + dependencies = { "saghen/blink.cmp" }, lazy = false, config = function() - local capabilities = vim.lsp.protocol.make_client_capabilities() + local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) vim.lsp.config.lua_ls = { capabilities = capabilities, @@ -36,6 +37,19 @@ return { vim.lsp.config.clangd = { capabilities = capabilities, + cmd = { + "clangd", + "--background-index", + "--clang-tidy", + "--completion-style=detailed", + "--header-insertion=iwyu", + "--header-insertion-decorators", + "--pch-storage=memory", + "--all-scopes-completion", + "--inlay-hints", + "--function-arg-placeholders", + "--fallback-style=llvm", + }, } vim.lsp.config.prismals = { -- cgit v1.3