NvChad / ui

Lightweight & high performance UI plugin for nvchad
GNU General Public License v3.0
166 stars 124 forks source link

chadrc options not applying #324

Closed Vortigern-The-Grey closed 1 month ago

Vortigern-The-Grey commented 1 month ago

I tried to enable nvdash and change the statusline in my chadrc, but the options don't apply. I think that for some reason, chadrc isn't being loaded. My chadrc:

-- This file needs to have same structure as nvconfig.lua 
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua

---@type ChadrcConfig
local M = {}

M.base46 = {
    theme = "catppuccin",

    -- hl_override = {
    --  Comment = { italic = true },
    --  ["@comment"] = { italic = true },
    -- },
},

M.ui = {

    statusline = {
      theme = "minimal", -- default/vscode/vscode_colored/minimal
      -- default/round/block/arrow separators work only for default statusline theme
      -- round and block will work for minimal theme only
      separator_style = "block",
      order = nil,
      modules = nil,
    },

    -- lazyload it when there are 1+ buffers
    tabufline = {
      enabled = true,
      lazyload = true,
      order = { "treeOffset", "buffers", "tabs", "btns" },
      modules = nil,
    },

    nvdash = {
        load_on_startup = true,
        header = {
          "           ▄ ▄                   ",
          "       ▄   ▄▄▄     ▄ ▄▄▄ ▄ ▄     ",
          "       █ ▄ █▄█ ▄▄▄ █ █▄█ █ █     ",
          "    ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █     ",
          "  ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄  ",
          "  █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄",
          "▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █",
          "█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █",
          "    █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█    ",
        },

        buttons = {
          { "  Find File", "Spc f f", "Telescope find_files" },
          { "󰈚  Recent Files", "Spc f o", "Telescope oldfiles" },
          { "󰈭  Find Word", "Spc f w", "Telescope live_grep" },
          { "  Bookmarks", "Spc m a", "Telescope marks" },
          { "  Themes", "Spc t h", "Telescope themes" },
          { "  Mappings", "Spc c h", "NvCheatsheet" },
          { "  Open lazy.nvim", "Spc l z", "Lazy" },
          { "󰏗  Open Mason", "Spc m s", "Mason" },
        },
    },
  },
}

return M

EDIT: changed the ui to M.ui, still didn't work.

Vortigern-The-Grey commented 1 month ago

How is chadrc loaded by NVChad?

siduck commented 1 month ago

because your ui table isnt even part of the root table which is M :/

siduck commented 1 month ago

M.ui ...

Vortigern-The-Grey commented 1 month ago

@siduck I realized that and changed it to M.ui, it still doesn't work.

siduck commented 1 month ago
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua

---@type ChadrcConfig
local M = {}

M.base46 = {
  theme = "catppuccin",

  -- hl_override = {
  --    Comment = { italic = true },
  --    ["@comment"] = { italic = true },
  -- },
}

M.ui = {

  statusline = {
    theme = "minimal", -- default/vscode/vscode_colored/minimal
    -- default/round/block/arrow separators work only for default statusline theme
    -- round and block will work for minimal theme only
    separator_style = "block",
    order = nil,
    modules = nil,
  },

  -- lazyload it when there are 1+ buffers
  tabufline = {
    enabled = true,
    lazyload = true,
    order = { "treeOffset", "buffers", "tabs", "btns" },
    modules = nil,
  },

  nvdash = {
    load_on_startup = true,
    header = {
      "           ▄ ▄                   ",
      "       ▄   ▄▄▄     ▄ ▄▄▄ ▄ ▄     ",
      "       █ ▄ █▄█ ▄▄▄ █ █▄█ █ █     ",
      "    ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █     ",
      "  ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄  ",
      "  █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄",
      "▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █",
      "█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █",
      "    █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█    ",
    },

    buttons = {
      { "  Find File", "Spc f f", "Telescope find_files" },
      { "󰈚  Recent Files", "Spc f o", "Telescope oldfiles" },
      { "󰈭  Find Word", "Spc f w", "Telescope live_grep" },
      { "  Bookmarks", "Spc m a", "Telescope marks" },
      { "  Themes", "Spc t h", "Telescope themes" },
      { "  Mappings", "Spc c h", "NvCheatsheet" },
      { "  Open lazy.nvim", "Spc l z", "Lazy" },
      { "󰏗  Open Mason", "Spc m s", "Mason" },
    },
  },
}

return M
siduck commented 1 month ago

how can you not see those syntax errors :((

siduck commented 1 month ago

please pay attention to lua lsp errors next time....

siduck commented 1 month ago

and you dont have to add default options if you are not changing them

siduck commented 1 month ago
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua

---@type ChadrcConfig
local M = {}

M.base46 = {
  theme = "catppuccin",

  -- hl_override = {
  --    Comment = { italic = true },
  --    ["@comment"] = { italic = true },
  -- },
}

M.ui = {
  statusline = {
    theme = "minimal",
    separator_style = "block",
  },

  nvdash = {
    load_on_startup = true,

    buttons = {
      { "  Find File", "Spc f f", "Telescope find_files" },
      { "󰈚  Recent Files", "Spc f o", "Telescope oldfiles" },
      { "󰈭  Find Word", "Spc f w", "Telescope live_grep" },
      { "  Bookmarks", "Spc m a", "Telescope marks" },
      { "  Themes", "Spc t h", "Telescope themes" },
      { "  Mappings", "Spc c h", "NvCheatsheet" },
      { "  Open lazy.nvim", "Spc l z", "Lazy" },
      { "󰏗  Open Mason", "Spc m s", "Mason" },
    },
  },
}

return M