neovim

Personal neovim configuration files
git clone git://gtms.dev/neovim
Log | Files | Refs

commit d672862e823cf52c1ae5f03a4e0b996578456907
parent 7256fd1f0fbf8839387a37d914a6254e6e2dd1c6
Author: Tomas Nemec <owl@gtms.dev>
Date:   Wed, 31 Jan 2024 07:16:48 +0100

update

Diffstat:
Mafter/plugin/cmp.lua | 30+++++++++++++++---------------
Mlua/tms/p/cmp/snippet_source.lua | 10++++------
2 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua @@ -121,22 +121,22 @@ cmp.setup({ { name = 'spell' }, { name = 'calc' }, -- { name = 'treesitter' }, - { name = 'buffer', group_index = 1 }, + { name = 'buffer', group_index = 1 }, }, { -- { name = 'buffer' }, }), - sorting = { - -- priority_weight = 2, - comparators = { - cmp.config.compare.offset, - cmp.config.compare.exact, - cmp.config.compare.score, - cmp.config.compare.kind, - cmp.config.compare.sort_text, - cmp.config.compare.length, - cmp.config.compare.order, - }, - }, + -- sorting = { + -- priority_weight = 2, + -- comparators = { + -- cmp.config.compare.offset, + -- cmp.config.compare.exact, + -- cmp.config.compare.score, + -- cmp.config.compare.kind, + -- cmp.config.compare.sort_text, + -- cmp.config.compare.length, + -- cmp.config.compare.order, + -- }, + -- }, -- experimental = { ghost_text = false }, }) @@ -192,9 +192,9 @@ cmp.setup.cmdline(':', { }, sources = cmp.config.sources({ -- { name = 'path' }, - }, { -- + }, { -- { name = 'cmdline' }, - }, { -- + }, { -- { name = 'cmdline_history' }, }), }) diff --git a/lua/tms/p/cmp/snippet_source.lua b/lua/tms/p/cmp/snippet_source.lua @@ -1,7 +1,5 @@ local M = {} -local cache = {} - function M:is_available() return true end @@ -11,7 +9,7 @@ function M:get_debug_name() end function M:complete(_, callback) - local snippets = require'tms.snippets'[vim.bo.filetype] or {} + local snippets = require 'tms.snippets'[vim.bo.filetype] or {} local response = {} @@ -30,7 +28,7 @@ function M:complete(_, callback) for _, p in ipairs(prefix) do table.insert(response, { label = p, - kind = require'cmp'.lsp.CompletionItemKind.Snippet, + kind = require 'cmp'.lsp.CompletionItemKind.Snippet, insertText = p, data = { prefix = p, body = body }, }) @@ -38,7 +36,7 @@ function M:complete(_, callback) else table.insert(response, { label = prefix, - kind = require'cmp'.lsp.CompletionItemKind.Snippet, + kind = require 'cmp'.lsp.CompletionItemKind.Snippet, insertText = prefix, data = { prefix = prefix, body = body }, }) @@ -48,7 +46,7 @@ function M:complete(_, callback) end function M:resolve(completion_item, callback) - completion_item.documentation = { kind = require'cmp'.lsp.MarkupKind.Markdown, value = completion_item.data.body } + completion_item.documentation = { kind = require 'cmp'.lsp.MarkupKind.Markdown, value = completion_item.data.body } callback(completion_item) end