From 7a1aecf89cf97cf4042f2ff68b785d4aa0a92f05 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Tue, 6 May 2025 14:20:36 +0800 Subject: [PATCH] refactor nvim: cmp --- .../nvim/exact_lua/lsp/exact_config/cmp.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dot_config/nvim/exact_lua/lsp/exact_config/cmp.lua b/dot_config/nvim/exact_lua/lsp/exact_config/cmp.lua index dd93e0d..b991583 100644 --- a/dot_config/nvim/exact_lua/lsp/exact_config/cmp.lua +++ b/dot_config/nvim/exact_lua/lsp/exact_config/cmp.lua @@ -22,6 +22,13 @@ cmp.setup({ -- completion = cmp.config.window.bordered(), -- documentation = cmp.config.window.bordered(), }, + formatting = { + format = require("lspkind").cmp_format { + mode = "symbol_text", -- 顯示圖示+文字 + maxwidth = 50, + ellipsis_char = "...", + }, + }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.select_next_item(), @@ -46,14 +53,6 @@ cmp.setup({ { name = 'buffer' }, { name = 'path' }, }), - - formatting = { - format = require("lspkind").cmp_format { - mode = "symbol_text", -- 顯示圖示+文字 - maxwidth = 50, - ellipsis_char = "...", - }, - }, }) -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below