summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrahmajit Das <listout@listout.xyz>2025-09-04 12:13:07 +0530
committerBrahmajit Das <listout@listout.xyz>2025-09-04 12:13:07 +0530
commitbc41eee545070374be4fdbffd018a889c62f63d7 (patch)
tree381b2551c52bd3a486a5f29cac40e8a140489cb6
parent9a7fae96d58b6caa1713c7b97e30abec25d3b22d (diff)
lua: plugins: completion: minor formatting
Signed-off-by: Brahmajit Das <listout@listout.xyz>
-rw-r--r--lua/plugins/completion.lua39
1 files changed, 2 insertions, 37 deletions
diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua
index adaccc5..d9b51c6 100644
--- a/lua/plugins/completion.lua
+++ b/lua/plugins/completion.lua
@@ -21,43 +21,9 @@ return {
{
"hrsh7th/nvim-cmp",
config = function()
- local has_words_before = function()
- local line, col = table.unpack(vim.api.nvim_win_get_cursor(0))
- return col ~= 0 and
- vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
- end
-
-- luasnip setup
local luasnip = require 'luasnip'
- local cmp_kinds = {
- Text = "",
- Method = "󰆧",
- Function = "󰊕",
- Constructor = "",
- Field = "󰇽",
- Variable = "󰂡",
- Class = "󰠱",
- Interface = "",
- Module = "",
- Property = "󰜢",
- Unit = "",
- Value = "󰎠",
- Enum = "",
- Keyword = "󰌋",
- Snippet = "",
- Color = "󰏘",
- File = "󰈙",
- Reference = "",
- Folder = "󰉋",
- EnumMember = "",
- Constant = "󰏿",
- Struct = "",
- Event = "",
- Operator = "󰆕",
- TypeParameter = "󰅲",
- }
-
-- nvim-cmp setup
local cmp = require 'cmp'
local lspkind = require('lspkind')
@@ -116,7 +82,6 @@ return {
fallback()
end
end, { "i", "s" }),
-
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
@@ -128,7 +93,6 @@ return {
end, { "i", "s" }),
}),
sources = cmp.config.sources({
- { name = 'luasnip', option = { show_autosnippets = true } },
{ name = 'nvim_lsp' },
{
name = 'luasnip',
@@ -172,7 +136,8 @@ return {
{ name = 'path' }
}, {
{ name = 'cmdline' }
- })
+ }),
+ matching = { disallow_symbol_nonprefix_matching = false }
})
-- If you want insert `(` after select function or method item