Anyone have autocomplete working with rust-tools, nvm-cmp, etc.?

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • nvim-cmp

    A completion plugin for neovim coded in Lua.

  • -- Provide some indication that rust-analyzer is busy! local lsp_status = require('lsp-status') lsp_status.register_progress() -- Basic rust/lsp/cmp settings from https://sharksforarms.dev/posts/neovim-rust/ local nvim_lsp = require('lspconfig') local opts = { tools = { -- rust-tools options autoSetHints = true, hover_with_actions = true, inlay_hints = { show_parameter_hints = false, parameter_hints_prefix = "", other_hints_prefix = "=> ", }, }, -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer server = { -- on_attach is a callback called when the language server attachs to the buffer on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities, settings = { -- to enable rust-analyzer settings visit: -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc -- and more: https://github.com/simrat39/rust-tools.nvim/wiki/Server-Configuration-Schema ["rust-analyzer"] = { -- enable clippy on save checkOnSave = { command = "clippy" }, } } }, } require('rust-tools').setup(opts) -- Setup Completion -- See https://github.com/hrsh7th/nvim-cmp#basic-configuration -- Used for super-tab functionality local has_words_before = function() local line, col = 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 local feedkey = function(key, mode) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end local lspkind = require('lspkind') local cmp = require'cmp' cmp.setup({ completion = { autocomplete = true }, -- Enable LSP snippets snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, mapping = { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, }), -- Add tab support [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif vim.fn["vsnip#available"](1) == 1 then feedkey("(vsnip-expand-or-jump)", "") elseif has_words_before() then cmp.complete() else fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. end end, { "i", "s" }), [""] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item() elseif vim.fn["vsnip#jumpable"](-1) == 1 then feedkey("(vsnip-jump-prev)", "") end end, { "i", "s" }), }, -- Installed sources sources = { { name = 'nvim_lsp' }, --, trigger_characters={'.', ":"} }, { name = 'vsnip' }, { name = 'path' }, { name = 'buffer' }, { name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_document_symbol' }, }, -- Fancy symbols formatting = { format = lspkind.cmp_format({ mode = 'symbol_text', -- show both symbol & text for now maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) -- The function below will be called before any actual modifications from lspkind -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) --before = function (entry, vim_item) --... --return vim_item --end }) }, completion = { autocomplete = true }, })

  • nvim-lspconfig

    Quickstart configs for Nvim LSP

  • -- Provide some indication that rust-analyzer is busy! local lsp_status = require('lsp-status') lsp_status.register_progress() -- Basic rust/lsp/cmp settings from https://sharksforarms.dev/posts/neovim-rust/ local nvim_lsp = require('lspconfig') local opts = { tools = { -- rust-tools options autoSetHints = true, hover_with_actions = true, inlay_hints = { show_parameter_hints = false, parameter_hints_prefix = "", other_hints_prefix = "=> ", }, }, -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer server = { -- on_attach is a callback called when the language server attachs to the buffer on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities, settings = { -- to enable rust-analyzer settings visit: -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc -- and more: https://github.com/simrat39/rust-tools.nvim/wiki/Server-Configuration-Schema ["rust-analyzer"] = { -- enable clippy on save checkOnSave = { command = "clippy" }, } } }, } require('rust-tools').setup(opts) -- Setup Completion -- See https://github.com/hrsh7th/nvim-cmp#basic-configuration -- Used for super-tab functionality local has_words_before = function() local line, col = 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 local feedkey = function(key, mode) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end local lspkind = require('lspkind') local cmp = require'cmp' cmp.setup({ completion = { autocomplete = true }, -- Enable LSP snippets snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, mapping = { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, }), -- Add tab support [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif vim.fn["vsnip#available"](1) == 1 then feedkey("(vsnip-expand-or-jump)", "") elseif has_words_before() then cmp.complete() else fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. end end, { "i", "s" }), [""] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item() elseif vim.fn["vsnip#jumpable"](-1) == 1 then feedkey("(vsnip-jump-prev)", "") end end, { "i", "s" }), }, -- Installed sources sources = { { name = 'nvim_lsp' }, --, trigger_characters={'.', ":"} }, { name = 'vsnip' }, { name = 'path' }, { name = 'buffer' }, { name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_document_symbol' }, }, -- Fancy symbols formatting = { format = lspkind.cmp_format({ mode = 'symbol_text', -- show both symbol & text for now maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) -- The function below will be called before any actual modifications from lspkind -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) --before = function (entry, vim_item) --... --return vim_item --end }) }, completion = { autocomplete = true }, })

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • rust-analyzer

    Discontinued A Rust compiler front-end for IDEs [Moved to: https://github.com/rust-lang/rust-analyzer] (by rust-analyzer)

  • -- Provide some indication that rust-analyzer is busy! local lsp_status = require('lsp-status') lsp_status.register_progress() -- Basic rust/lsp/cmp settings from https://sharksforarms.dev/posts/neovim-rust/ local nvim_lsp = require('lspconfig') local opts = { tools = { -- rust-tools options autoSetHints = true, hover_with_actions = true, inlay_hints = { show_parameter_hints = false, parameter_hints_prefix = "", other_hints_prefix = "=> ", }, }, -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer server = { -- on_attach is a callback called when the language server attachs to the buffer on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities, settings = { -- to enable rust-analyzer settings visit: -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc -- and more: https://github.com/simrat39/rust-tools.nvim/wiki/Server-Configuration-Schema ["rust-analyzer"] = { -- enable clippy on save checkOnSave = { command = "clippy" }, } } }, } require('rust-tools').setup(opts) -- Setup Completion -- See https://github.com/hrsh7th/nvim-cmp#basic-configuration -- Used for super-tab functionality local has_words_before = function() local line, col = 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 local feedkey = function(key, mode) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end local lspkind = require('lspkind') local cmp = require'cmp' cmp.setup({ completion = { autocomplete = true }, -- Enable LSP snippets snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, mapping = { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, }), -- Add tab support [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif vim.fn["vsnip#available"](1) == 1 then feedkey("(vsnip-expand-or-jump)", "") elseif has_words_before() then cmp.complete() else fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. end end, { "i", "s" }), [""] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item() elseif vim.fn["vsnip#jumpable"](-1) == 1 then feedkey("(vsnip-jump-prev)", "") end end, { "i", "s" }), }, -- Installed sources sources = { { name = 'nvim_lsp' }, --, trigger_characters={'.', ":"} }, { name = 'vsnip' }, { name = 'path' }, { name = 'buffer' }, { name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_document_symbol' }, }, -- Fancy symbols formatting = { format = lspkind.cmp_format({ mode = 'symbol_text', -- show both symbol & text for now maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) -- The function below will be called before any actual modifications from lspkind -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) --before = function (entry, vim_item) --... --return vim_item --end }) }, completion = { autocomplete = true }, })

  • rust-tools.nvim

    Discontinued Tools for better development in rust using neovim's builtin lsp

  • -- Provide some indication that rust-analyzer is busy! local lsp_status = require('lsp-status') lsp_status.register_progress() -- Basic rust/lsp/cmp settings from https://sharksforarms.dev/posts/neovim-rust/ local nvim_lsp = require('lspconfig') local opts = { tools = { -- rust-tools options autoSetHints = true, hover_with_actions = true, inlay_hints = { show_parameter_hints = false, parameter_hints_prefix = "", other_hints_prefix = "=> ", }, }, -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer server = { -- on_attach is a callback called when the language server attachs to the buffer on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities, settings = { -- to enable rust-analyzer settings visit: -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc -- and more: https://github.com/simrat39/rust-tools.nvim/wiki/Server-Configuration-Schema ["rust-analyzer"] = { -- enable clippy on save checkOnSave = { command = "clippy" }, } } }, } require('rust-tools').setup(opts) -- Setup Completion -- See https://github.com/hrsh7th/nvim-cmp#basic-configuration -- Used for super-tab functionality local has_words_before = function() local line, col = 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 local feedkey = function(key, mode) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end local lspkind = require('lspkind') local cmp = require'cmp' cmp.setup({ completion = { autocomplete = true }, -- Enable LSP snippets snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, mapping = { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, }), -- Add tab support [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif vim.fn["vsnip#available"](1) == 1 then feedkey("(vsnip-expand-or-jump)", "") elseif has_words_before() then cmp.complete() else fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. end end, { "i", "s" }), [""] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item() elseif vim.fn["vsnip#jumpable"](-1) == 1 then feedkey("(vsnip-jump-prev)", "") end end, { "i", "s" }), }, -- Installed sources sources = { { name = 'nvim_lsp' }, --, trigger_characters={'.', ":"} }, { name = 'vsnip' }, { name = 'path' }, { name = 'buffer' }, { name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_document_symbol' }, }, -- Fancy symbols formatting = { format = lspkind.cmp_format({ mode = 'symbol_text', -- show both symbol & text for now maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) -- The function below will be called before any actual modifications from lspkind -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) --before = function (entry, vim_item) --... --return vim_item --end }) }, completion = { autocomplete = true }, })

  • lspkind.nvim

    vscode-like pictograms for neovim lsp completion items

  • -- Provide some indication that rust-analyzer is busy! local lsp_status = require('lsp-status') lsp_status.register_progress() -- Basic rust/lsp/cmp settings from https://sharksforarms.dev/posts/neovim-rust/ local nvim_lsp = require('lspconfig') local opts = { tools = { -- rust-tools options autoSetHints = true, hover_with_actions = true, inlay_hints = { show_parameter_hints = false, parameter_hints_prefix = "", other_hints_prefix = "=> ", }, }, -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer server = { -- on_attach is a callback called when the language server attachs to the buffer on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities, settings = { -- to enable rust-analyzer settings visit: -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc -- and more: https://github.com/simrat39/rust-tools.nvim/wiki/Server-Configuration-Schema ["rust-analyzer"] = { -- enable clippy on save checkOnSave = { command = "clippy" }, } } }, } require('rust-tools').setup(opts) -- Setup Completion -- See https://github.com/hrsh7th/nvim-cmp#basic-configuration -- Used for super-tab functionality local has_words_before = function() local line, col = 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 local feedkey = function(key, mode) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end local lspkind = require('lspkind') local cmp = require'cmp' cmp.setup({ completion = { autocomplete = true }, -- Enable LSP snippets snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, mapping = { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, }), -- Add tab support [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif vim.fn["vsnip#available"](1) == 1 then feedkey("(vsnip-expand-or-jump)", "") elseif has_words_before() then cmp.complete() else fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. end end, { "i", "s" }), [""] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item() elseif vim.fn["vsnip#jumpable"](-1) == 1 then feedkey("(vsnip-jump-prev)", "") end end, { "i", "s" }), }, -- Installed sources sources = { { name = 'nvim_lsp' }, --, trigger_characters={'.', ":"} }, { name = 'vsnip' }, { name = 'path' }, { name = 'buffer' }, { name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_document_symbol' }, }, -- Fancy symbols formatting = { format = lspkind.cmp_format({ mode = 'symbol_text', -- show both symbol & text for now maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) -- The function below will be called before any actual modifications from lspkind -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) --before = function (entry, vim_item) --... --return vim_item --end }) }, completion = { autocomplete = true }, })

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts