From 46db63749f5635bff5d85100caa828cbfc1a7b7c Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Tue, 1 Feb 2022 16:39:51 +0530 Subject: [PATCH] cmp: Add border to floating docs, move completeopt inside config format files --- lua/core/mappings.lua | 4 ++-- lua/plugins/configs/cmp.lua | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 5518bc5..29557fe 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -84,8 +84,8 @@ M.misc = function() map("n", maps.misc.cheatsheet, ":lua require('nvchad.cheatsheet').show() ") -- show keybinds map("n", maps.misc.close_buffer, ":lua require('core.utils').close_buffer() ") -- close buffer map("n", maps.misc.copy_whole_file, ":%y+ ") -- copy whole file content - map("v", maps.misc.copy_to_system_clipboard, "\"+y") - map("n", maps.misc.copy_to_system_clipboard, "\"+yy") -- copy curent line in normal mode + map("v", maps.misc.copy_to_system_clipboard, '"+y') + map("n", maps.misc.copy_to_system_clipboard, '"+yy') -- copy curent line in normal mode map("n", maps.misc.new_buffer, ":enew ") -- new buffer map("n", maps.misc.new_tab, ":tabnew ") -- new tabs map("n", maps.misc.line_number_toggle, ":set nu! ") -- toggle numbers diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index a958e74..c61086b 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -6,15 +6,19 @@ end local snippets_status = require("core.utils").load_config().plugins.status.snippets -vim.opt.completeopt = "menuone,noselect" - local default = { + completion = { + completeopt = "menuone,noselect", + }, + documentation = { + border = "single", + }, snippet = (snippets_status and { expand = function(args) require("luasnip").lsp_expand(args.body) end, }) or { - expand = function(args) end, + expand = function(_) end, }, formatting = { format = function(entry, vim_item) @@ -22,9 +26,10 @@ local default = { vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind) vim_item.menu = ({ + buffer = "[BUF]", nvim_lsp = "[LSP]", nvim_lua = "[Lua]", - buffer = "[BUF]", + path = "[Path]", })[entry.source.name] return vim_item