nix-community / nixvim

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

[BUG] dashboard plugin not working maybe due to `vimEnter` event. #1513

Open Eveeifyeve opened 4 months ago

Eveeifyeve commented 4 months ago
Field Description
Plugin dashborad
Nixpkgs nixpkgs-unstable
Nix-Darwin *

Description

The issue is when dashboard is enabled it doesn't run on vim enter which therefore shows the default Neovim. Dashborad includes a guide on how to do this here

Minimal, Reproducible Example (MRE)

{ pkgs, ... }:
{
  programs.nixvim = {
    enable = true;
    colorschemes.catppuccin.enable = true;
    plugins = {
      nvim-autopairs.enable = true;
      luasnip.enable = true;
      treesitter.enable = true;

      trouble.enable = true;
      bufferline.enable = true;
      dashboard = {
        enable = true;
        center = [
          {
            desc = "Find project";
            icon = "📁";
            action = "Telescope find_files";
          }
          {
            desc = "Configuration";
            icon = "⚙️";
            action = "Telescope find_files ";
          }
        ];
        hideStatusline = true;
        hideTabline = true;
      };

      auto-save = {
        enable = true;
        enableAutoSave = true;
      };
      lightline.enable = true;
      telescope.enable = true;

      lazy.enable = true;
      direnv.enable = true;
      neocord.enable = true;

      lsp = {
        enable = true;
        servers = {
          rust-analyzer = {
            enable = true;
            autostart = true;
            installCargo = false;
            installRustc = false;
          };
          kotlin-language-server = {
            enable = true;
            autostart = true;
          };
          nil_ls = {
            enable = true;
            autostart = true;
          };
          java-language-server = {
            enable = true;
            autostart = true;
          };
          biome = {
            enable = true;
            autostart = true;
          };
          astro = {
            enable = true;
            autostart = true;
          };
          tsserver = {
            enable = true;
            autostart = true;
          };
          html = {
            enable = true;
            autostart = true;
          };
        };
      };
      cmp = {
        enable = true;
        autoEnableSources = true;
      };

      ccc.enable = true;
      codeium-nvim.enable = true;
      comment.enable = true;

      project-nvim.enable = true;
      todo-comments.enable = true;
      barbar = {
        enable = true;
        autoHide = true;
      };
    };
extraConfigLua = ''
  vim.api.nvim_exec([[
    augroup DashboardOnVimEnter
      autocmd!
      autocmd VimEnter * Dashboard
    augroup END
  ]], false)
'';
  };
}
khaneliman commented 1 week ago

I see that we recently refactored this module in https://github.com/nix-community/nixvim/pull/1590 so double checking if you are still seeing this behavior? I was able to get it to work with just this config:

{
  plugins.dashboard = {
    enable = true;
    center = [
      {
        desc = "Find project";
        icon = "📁";
        action = "Telescope find_files";
      }
      {
        desc = "Configuration";
        icon = "⚙️";
        action = "Telescope find_files ";
      }
    ];
    hideStatusline = true;
    hideTabline = true;
  };
}
Eveeifyeve commented 1 week ago

I will try it tmr as it's 3am here.