[SOLVED] Help getting vim with python3 support working

Hi,

i want to have vim configured globally with python3 enabled. i tried following the wiki
and ended up with this:

a vim.nix

{ pkgs, ... }:
pkgs.vim_configurable.customize  {
  name = "vim";
  vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
    start = [ vim-nix deoplete-jedi vim-lastplace ];
  };  
  vimrcConfig.customRC = ''
   " customRC...
  '';
}

and i include it in my configuration.nix packages like so:

{
  environment.systemPackages = with pkgs; [
    (pkgs.callPackage ./vim.nix { vim_configurable = vim_configurable.override { python = python3; }; })
  ];
}

when i rebuild and type :echo has("python3") it returns 0.
what am i not getting here?

EDIT: forgot to mention that i am on channel nixos-20.03

1 Like

i’ve sorted it out with help from @srhb via irc

my vim.nix now looks like this:

{ pkgs, ... }:
{
  programs.vim.defaultEditor = true;

  environment.systemPackages = with pkgs; [
    ((vim_configurable.override { python = python3; }).customize {
      name = "vim";
      vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
        start = [ vim-nix ]; # load plugins on startup
      };
      vimrcConfig.customRC = ''
        " custom
        " vimrc
      '';
    })
  ];
}

and i import it from my configuration nix with imports = [ ./vim.nix ]

1 Like

Please mark your own comment as “Solved”.