commit 76024032a53a16d7f2e3f236c0e1badd69573f1b
parent d14a0ae7b8d6df458f1b3b06a6b54f1cdbf3d604
Author: Chris Bracken <chris@bracken.jp>
Date: Thu, 5 Sep 2024 14:58:22 -0700
vim: eliminate nvim-cmp
Completions are really slow compared to <C-X><C-O>, though the one nice
feature it has is the ability to truncate the `abbr` value for
completions to a shorter length. Eliminating the plugin might
incentivise me to figure out how to hook into lsp-omnicomplete to do
that myself.
Diffstat:
2 files changed, 2 insertions(+), 51 deletions(-)
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json
@@ -1,14 +1,10 @@
{
- "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
- "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
- "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
"fzf-lua": { "branch": "main", "commit": "db41613292b88b5306d65caf6ae8996db5498ccb" },
"gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" },
- "gn": { "branch": "main", "commit": "a737c2849f13f47b7808020f1a37c8403da66d92" },
+ "gn": { "branch": "main", "commit": "60a28b63605752b63b6f1d467e1c8363d6e81a79" },
"lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" },
- "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
- "nvim-lspconfig": { "branch": "master", "commit": "0ef64599b8aa0187ee5f6d92cb39c951f348f041" },
+ "nvim-lspconfig": { "branch": "master", "commit": "bdbc65aadc708ce528efb22bca5f82a7cca6b54d" },
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
"solarized-osaka.nvim": { "branch": "main", "commit": "126d394c0c979a99206214a2b6b8c86e456c9c0f" },
"vim-beancount": { "branch": "master", "commit": "25bcbc773554b5798d253a1a5fa5de158792f95e" },
diff --git a/.config/nvim/lua/plugins/languages.lua b/.config/nvim/lua/plugins/languages.lua
@@ -6,51 +6,6 @@ return {
vim.opt.rtp:append(plugin.dir .. "/misc/vim")
end
},
- {
- "hrsh7th/nvim-cmp",
- opts = {},
- event = "InsertEnter",
- config = function()
- local cmp = require("cmp")
- cmp.setup({
- completion = {
- autocomplete = false,
- completeopt = "menu,menuone,preview,noselect",
- },
- window = {
- completion = cmp.config.window.bordered(),
- documentation = cmp.config.window.bordered(),
- },
- mapping = cmp.mapping.preset.insert({
- ['<C-k>'] = cmp.mapping.select_prev_item(),
- ['<C-j>'] = cmp.mapping.select_next_item(),
- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
- ['<C-f>'] = cmp.mapping.scroll_docs(4),
- ['<CR>'] = cmp.mapping.confirm({ select = true }),
- }),
- sources = cmp.config.sources({
- { name = "nvim_lsp" },
- { name = "buffer" },
- { name = "path" },
- }),
- formatting = {
- format = function(entry, vim_item)
- -- Truncate completions to some maximum length.
- local max_width = 60
- if vim.fn.strchars(vim_item.abbr) > max_width then
- vim_item.abbr = vim.fn.strcharpart(vim_item.abbr, 0, max_width) .. "…"
- end
- return vim_item
- end
- }
- })
- end,
- dependencies = {
- "hrsh7th/cmp-buffer",
- "hrsh7th/cmp-nvim-lsp",
- "hrsh7th/cmp-path",
- },
- },
{ "nathangrigg/vim-beancount" },
{
"neovim/nvim-lspconfig",