nix-community / nixvim

Configure Neovim with Nix! [maintainers=@GaetanLepage, @traxys, @mattsturgeon, @khaneliman]
https://nix-community.github.io/nixvim
MIT License
1.81k stars 282 forks source link

Switching to init.lua completely broke nixvim #65

Closed gilice closed 2 years ago

gilice commented 2 years ago

Plugin affected: * Nixpkgs channel: unstable Home-manager version: master

Description

Before 3849a1de9a28ed5434e864b8f2815c905a8d28ad, everything seemed fine. Now, the generated init.lua is 10 lines long, filled with 10 empty lines.

Config

  programs.nixvim = {

    enable = true;
    colorschemes.gruvbox = {
      enable = true;
      contrastLight = "hard";
      contrastDark = "hard";
    };

    options = {
      number = true;
      shiftwidth = 2;
      tabstop = 2;
      guifont = "FiraCode\ Nerd\ Font\ Mono:h14";
    };

    plugins = {
      lsp = {
        enable = true;
        servers.rnix-lsp.enable = true;
        servers.rust-analyzer.enable = true;
        servers.jsonls.enable = true;
      };

      nvim-tree = {
        enable = true;
        openOnSetup = true;
        openOnTab = true;
      };

      telescope = {
        enable = true;
      };

      nvim-cmp = {
        formatting = {
          format = ''
                                require("lspkind").cmp_format({
                                    mode="symbol",
                                    maxwidth = 50,
                                    ellipsis_char = "..."
                                })
                                '';
        };

        auto_enable_sources = true;
        snippet = {
          expand = ''
                   function(args)
                     require("luasnip").lsp_expand(args.body)
                   end
                 '';
        };
        enable = true;
        sources = [
          { name = "nvim_lsp"; }
          {
            name = "luasnip";
            option = {
              show_autosnippets = true;
            };
          }
          { name = "path"; }
          { name = "buffer"; }
        ];

      };
      barbar.enable = true;
    };

    globals.mapleader = " ";
    extraPlugins = with pkgs.vimPlugins; [
      which-key-nvim
      leap-nvim
      vim-flutter
      plenary-nvim
      fidget-nvim
      luasnip
      lspkind-nvim
    ];

    extraConfigLua = (builtins.readFile ./nvim-extra-lua.lua);
  };
}
pta2002 commented 2 years ago

Oh god D: I'll try to fix this asap

pta2002 commented 2 years ago

Should(?) be fixed! Can you try it @gilice?

gilice commented 2 years ago

seems fine. thanks !!