r/neovim•
Linuxdirk

How to setup auto completion, etc. using LSP and stuff without bloating everything with a plugin manager?

Edit: I gave up and installed the Packer plugin manager to handle plugins with it. Still haven't figured out how to get auto completion and this handy popup when typing code. But that's a question for another investigation.

Hey!

Pretty new neovim user here.

I am totally not a fan of too much configuration and plugins, so I prefer to set it up without using packer, or plug, or whatever fancy plugin manager one prefers.

I managed to set up neovim with my old vim settings and it works as expected. I also installed and set up the treesitter syntax highlighting by using my distribution's package manager for installation of the plugin. Which is fine, so I don't need to reinstall it for all users all the time. It also works as expected, so the setup works in general (i.e.: installing the plugin using the distribution's package manager and just configuring the plugin in init.lua).

I wonder if it is possible to set up LSP the same simple way to have autocompletion with dropdown. I tried various things but either an error message appears (language server not in path or file not executable) or nothing happens.

The package neovim/nvim-lspconfig can be installed using my distribution's package manager and does not need to be handled within neovim's setup. I just need to find a way to have it configured.

Ideally I can set it all up in the same style as I was able to set up treesitter in init.lua:

[various vim.opt.xyz settings that all work as expected]

-- Treesitter
--
-- Installed: neovim-nvim-treesitter
-- Git:       https://github.com/nvim-treesitter/nvim-treesitter
require'nvim-treesitter.configs'.setup {
  ensure_installed = { "c", "lua", "vim", "help" },
  sync_install = false,
  auto_install = true,
  ignore_install = {},

  highlight = {
    enable = true,
    disable = {},
    additional_vim_regex_highlighting = false,
  }
}

Thank in advance!

Posted Feb 10, 2023, 10:30 AM UTC · edited

211
Loading comments…