Coc.nvim, nvim, stuff

the python mpls server has been merged so it possible to install and use coc just for configuration. I personally switched to the builtin lsp since the lua ecosystem is more approachable for me than node (on nixpkgs).

Do you mean the builtin lsp of neovim or something else? I thought that was only available for neovim version 5.0? Did you build this version yourself? Was it a lot of work to build it successfully?

I would like to test out the embedded lsp server, as I find coc.vim a bit bloated and wasn’t able to make it work for all the things I need.

I was referring to the master version of nvim (called 0.5 but unreleased yet).

You should be fine with the following in your overlay

  neovim-unwrapped = final.neovim-unwrapped.overrideAttrs (oldAttrs: {
	  name = "neovim";
	  version = "official-master";
      src = builtins.fetchGit {
        url = https://github.com/neovim/neovim.git;
        ref = "master";
      };
 
  });
2 Likes

Hello!

I’ve just made a pull request to coc-python to make it use the python-language-server that’s in unstable nixpkgs right now.

https://github.com/neoclide/coc-python/pull/266

To use it right now, you can do

Plug 'irth/coc-python', {'branch': 'allow-changing-language-server-path', 'do': 'yarn install && yarn build'}

for vim-plug (or adapt that for your plugin management solution)

and then, in the coc-settings.json:

"python.autoUpdateLanguageServer": false,
"python.languageServerPath": "python-language-server"

Works like a charm :slight_smile:

3 Likes

Thanks for this code snippet regarding neovim nightly. Since I didn’t know much about overlays in nix I had to put it on hold, but now I finally was able to make it work. What I essentially did was to put this as my overlay.nix:

cat ~/.config/nixpkgs/overlays.nix

code:

[ (self: super:
{
  neovim-unwrapped = super.neovim-unwrapped.overrideAttrs (oldAttrs: rec {
    name = "neovim-nightly";
    version = "0.5-nightly";
    src = self.fetchurl {
      url = "https://github.com/neovim/neovim/archive/master.zip";
      sha256 = "01ad4sfavyhjaylzbqm0ynrngl38bkxai37yn16hryslk5rsb1jg";
    };

    nativeBuildInputs = with self.pkgs; [ unzip cmake pkgconfig gettext ];

  });

}) ]

then inside a clone of nixpkgs, I did nix-env -f "." -iA neovim, and it worked.

I think the nativeBuildInputs, could have been done like this:

nativeBuildInputs = with self.pkgs; [ unzip ] ++ super.nativeBuildInputs;

But then I get this failure:

error: attribute 'nativeBuildInputs' missing

I must say that overlays are really hard to get right and the documentation is a bit convoluted.

For anyone mastering overlays, it would be would nice to get feedback on this approach :slight_smile:

I guess that putting them at the system level like in this example is a better approach, maybe I’ll try that next:

1 Like