goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.82k stars 109 forks source link

Alpha startup page conflicts with lsp #288

Closed Seanwanq closed 2 months ago

Seanwanq commented 2 months ago

My alpha startup page seems to conflict with mason.nvim, mason-lspconfig.nvim or nvim-lspconfig, resulting in this style on my startup page.

neovim startpage

I use lazy.nvim to manage plugins, the content is as follows:

-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  local lazyrepo = "https://github.com/folke/lazy.nvim.git"
  local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
  if vim.v.shell_error ~= 0 then
    vim.api.nvim_echo({
      { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
      { out, "WarningMsg" },
      { "\nPress any key to exit..." },
    }, true, {})
    vim.fn.getchar()
    os.exit(1)
  end
end
vim.opt.rtp:prepend(lazypath)

-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"

-- Setup lazy.nvim
require("lazy").setup({
  spec = {
    -- import your plugins
    { 
      "folke/todo-comments.nvim", 
      dependencies = { "nvim-lua/plenary.nvim" },
      opts = {} 
    },
    {
      "nvim-tree/nvim-web-devicons",
      opts = {}
    },
    {
      "folke/which-key.nvim",
      event = "VeryLazy",
      init = function()
        vim.o.timeout = true
        vim.o.timeoutlen = 300
      end,
      opts = {}
    },
    {
      "nvim-tree/nvim-tree.lua",
      lazy = false,
      dependencies = {
        "nvim-tree/nvim-web-devicons",
      },
    },
    {
      "windwp/nvim-autopairs",
      event = "InsertEnter",
      config = true,
      opts = {
      },
    },
    {
      "numToStr/Comment.nvim",
      opts = {
      },
    },
    {
      "HiPhish/rainbow-delimiters.nvim",
      config = function()
        require('rainbow-delimiters.setup').setup {}
      end
    },
    {
      "nvim-treesitter/nvim-treesitter",
      config = function()
        local configs = require("nvim-treesitter.configs")

        configs.setup({
          ensure_installed = { "c", "lua", "vim", "vimdoc",
                               "query", "elixir", "heex", 
                               "javascript", "html", "c_sharp",
                               "python", "julia",
                              },
          sync_install = false,
          highlight = { enable = true },
          indent = { enable = true },
        })
      end
    },
    {
      "mhartington/formatter.nvim",
    },
    {
      "akinsho/bufferline.nvim",
      dependencies = {
        "nvim-tree/nvim-web-devicons",
      },
      opts = {
        options = {
          diagnostics = "nvim_lsp",
          offsets = {
            {
              filetype = "NvimTree",
              text = "File Explorer",
              highlight = "Directory",
              text_align = "left",
            },
          },
        },
      },
    },
    {
      'nvim-lualine/lualine.nvim',
      dependencies = { 'nvim-tree/nvim-web-devicons' },
      opts = {
        options = { theme = 'codedark' }
      },
    },
    {
      "lewis6991/gitsigns.nvim",
    },
    { "tiagovla/scope.nvim", opts = {} },
    {
      "nvim-telescope/telescope.nvim",
      dependencies = { 'nvim-lua/plenary.nvim' },
      branch = '0.1.x',
      config = function()
        require("telescope").load_extension("scope")
      end
    },
    {
      "williamboman/mason.nvim",
    },
    {
      "williamboman/mason-lspconfig.nvim",
    },
    {
      "neovim/nvim-lspconfig",
    },
    {
      "rcarriga/nvim-dap-ui",
      dependencies = {
        "mfussenegger/nvim-dap",
        "nvim-neotest/nvim-nio",
      },
      config = function()
        require("dapui").setup {}
      end
    },
    {
      "mfussenegger/nvim-lint",
    },
    {
      'goolord/alpha-nvim',
      config = function ()
        require'alpha'.setup(require'alpha.themes.dashboard'.config)
      end
    },
  },
  -- Configure any other settings here. See the documentation for more details.
  -- colorscheme that will be used when installing plugins.
  install = { colorscheme = { "habamax" } },
  -- automatically check for plugin updates
  checker = { enabled = true },
})

The configuration of mason-lsp and lspconfig is:

require("mason-lspconfig").setup {
  ensure_installed = {
    "lua_ls",
    "rust_analyzer",
    "tinymist",
    "julials",
    "ltex",
    "csharp_ls",
    "zls",
    "clangd",
    "neocmake",
    "pylsp",
  },
}

require("lspconfig").lua_ls.setup {}

require("lspconfig").rust_analyzer.setup {}

require("lspconfig").tinymist.setup {}

require("lspconfig").julials.setup {}

require("lspconfig").ltex.setup {}

require("lspconfig").csharp_ls.setup {}

require("lspconfig").zls.setup {}

require("lspconfig").clangd.setup {}

require("lspconfig").neocmake.setup {}

require("lspconfig").pylsp.setup {}

Thanks for helping me.

goolord commented 2 months ago

mfussenegger/nvim-lint stands out as suspicious to me, as it seems to enable a spellcheck linter. maybe try

require('lint').linters_by_ft = {
  alpha = {}
}
goolord commented 2 months ago

or grep your config for something like require("lint").try_lint("cspell")

Seanwanq commented 2 months ago

or grep your config for something like require("lint").try_lint("cspell")

Thanks! This works.