diff --git a/init.lua b/init.lua index f93452c..c925644 100644 --- a/init.lua +++ b/init.lua @@ -26,7 +26,7 @@ vim.diagnostic.config({ vim.pack.add({ "https://github.com/folke/snacks.nvim", "https://github.com/nvim-lualine/lualine.nvim", - "https://github.com/RRethy/base16-nvim", + "https://github.com/RRethy/base16-nvim", "https://github.com/akinsho/bufferline.nvim", "https://github.com/nvimdev/lspsaga.nvim", "https://github.com/neovim/nvim-lspconfig", @@ -34,19 +34,31 @@ vim.pack.add({ "https://github.com/vyfor/cord.nvim", "https://github.com/mason-org/mason-lspconfig.nvim.git", "https://github.com/mason-org/mason.nvim.git", + { src = "https://github.com/Saghen/blink.cmp", version = "v1" }, }) vim.lsp.config("qmlls", { cmd = { "qmlls6" }, }) +require("blink.cmp").setup({ + fuzzy = { implementation = "prefer_rust_with_warning" }, + completion = { + menu = { + auto_show = false, + }, + }, + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, +}) require("mason").setup() require("mason-lspconfig").setup() require("bufferline").setup({ options = { - themable = true, + themable = true, numbers = "ordinal", indicator = { - icon = '', + icon = "", style = "underline", }, }, @@ -89,6 +101,7 @@ require("lualine").setup({ lualine_z = { "location" }, }, }) + -- keymaps local map = vim.keymap.set @@ -133,55 +146,6 @@ map("n", "t", " terminal ") map("n", "", "Lspsaga term_toggle") map("t", "", "") map("i", "", vim.lsp.completion.get, { desc = "trigger autocompletion" }) --- lsp setup -vim.lsp.config("*", { - on_attach = function(client, bufnr) - vim.lsp.completion.enable(true, client.id, bufnr, { - autotrigger = true, - convert = function(item) - return { abbr = item.label:gsub("%b()", "") } - end, - }) - vim.keymap.set("i", "", vim.lsp.completion.get, { desc = "trigger autocompletion" }) - end, -}) - -vim.o.complete = ".,o" -- use buffer and omnifunc -vim.o.completeopt = "fuzzy,menuone,noselect" -- add 'popup' for docs (sometimes) -vim.o.autocomplete = true -vim.o.pumheight = 7 - --- setup autocomplete -vim.api.nvim_create_autocmd("LspAttach", { - callback = function(ev) - vim.lsp.completion.enable(true, ev.data.client_id, ev.buf, { - -- Optional formating of items - convert = function(item) - -- Remove leading misc chars for abbr name, - -- and cap field to 25 chars - --local abbr = item.label - --abbr = abbr:match("[%w_.]+.*") or abbr - --abbr = #abbr > 25 and abbr:sub(1, 24) .. "…" or abbr - -- - -- Remove return value - --local menu = "" - - -- Only show abbr name, remove leading misc chars (bullets etc.), - -- and cap field to 15 chars - local abbr = item.label - abbr = abbr:gsub("%b()", ""):gsub("%b{}", "") - abbr = abbr:match("[%w_.]+.*") or abbr - abbr = #abbr > 15 and abbr:sub(1, 14) .. "…" or abbr - - -- Cap return value field to 15 chars - local menu = item.detail or "" - menu = #menu > 15 and menu:sub(1, 14) .. "…" or menu - - return { abbr = abbr, menu = menu } - end, - }) - end, -}) -- tinty function local default_theme = "base16-oceanicnext" diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index e77dc2f..fd15508 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -4,6 +4,11 @@ "rev": "190397833e53fdfd5cf400c5baaf1a4e533158e5", "src": "https://github.com/RRethy/base16-nvim" }, + "blink.cmp": { + "rev": "78336bc89ee5365633bcf754d93df01678b5c08f", + "src": "https://github.com/Saghen/blink.cmp", + "version": "'v1'" + }, "bufferline.nvim": { "rev": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3", "src": "https://github.com/akinsho/bufferline.nvim"