nvim: disable cmp

This commit is contained in:
Motiejus Jakštys 2023-10-23 12:17:28 +03:00 committed by Motiejus Jakštys
parent 4d7028f2fe
commit c6e158d417

View File

@ -56,43 +56,44 @@ map("n", "]c", function()
vim.diagnostic.goto_next({ wrap = false }) vim.diagnostic.goto_next({ wrap = false })
end) end)
-- completion related settings -- Completion related settings. Disabling (motiejus 2023-10-23), because I
-- This is similiar to what I use -- can't get C-n to work on "simple" files.
local cmp = require("cmp") --
cmp.setup({ --local cmp = require("cmp")
sources = { --cmp.setup({
{ name = "nvim_lsp" }, -- sources = {
{ name = "vsnip" }, -- { name = "nvim_lsp" },
}, -- { name = "vsnip" },
snippet = { -- },
expand = function(args) -- snippet = {
-- Comes from vsnip -- expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- -- Comes from vsnip
end, -- vim.fn["vsnip#anonymous"](args.body)
}, -- end,
mapping = cmp.mapping.preset.insert({ -- },
-- None of this made sense to me when first looking into this since there -- mapping = cmp.mapping.preset.insert({
-- is no vim docs, but you can't have select = true here _unless_ you are -- -- None of this made sense to me when first looking into this since there
-- also using the snippet stuff. So keep in mind that if you remove -- -- is no vim docs, but you can't have select = true here _unless_ you are
-- snippets you need to remove this select -- -- also using the snippet stuff. So keep in mind that if you remove
["<CR>"] = cmp.mapping.confirm({ select = true }), -- -- snippets you need to remove this select
-- I use tabs... some say you should stick to ins-completion but this is just here as an example -- ["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = function(fallback) -- -- I use tabs... some say you should stick to ins-completion but this is just here as an example
if cmp.visible() then -- ["<Tab>"] = function(fallback)
cmp.select_next_item() -- if cmp.visible() then
else -- cmp.select_next_item()
fallback() -- else
end -- fallback()
end, -- end
["<S-Tab>"] = function(fallback) -- end,
if cmp.visible() then -- ["<S-Tab>"] = function(fallback)
cmp.select_prev_item() -- if cmp.visible() then
else -- cmp.select_prev_item()
fallback() -- else
end -- fallback()
end, -- end
}), -- end,
}) -- }),
--})
@ -117,7 +118,8 @@ metals_config.settings = {
metals_config.init_options.statusBarProvider = "on" metals_config.init_options.statusBarProvider = "on"
-- Example if you are using cmp how to make sure the correct capabilities for snippets are set -- Example if you are using cmp how to make sure the correct capabilities for snippets are set
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() -- TODO(motiejus) disabled with cmp 2023-10-23
--metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Autocmd that will actually be in charging of starting the whole thing -- Autocmd that will actually be in charging of starting the whole thing
local nvim_metals_group = api.nvim_create_augroup("nvim-metals", { clear = true }) local nvim_metals_group = api.nvim_create_augroup("nvim-metals", { clear = true })