Skip to content

Instantly share code, notes, and snippets.

@siduck
Last active June 28, 2024 00:49
Show Gist options
  • Save siduck/cc7305db586d512b5fd3f4ea73c9cc81 to your computer and use it in GitHub Desktop.
Save siduck/cc7305db586d512b5fd3f4ea73c9cc81 to your computer and use it in GitHub Desktop.
vim.g.base46_cache = vim.fn.stdpath('data') .. '/base46_cache/'
  • Make sure to read nvconfig to know default options
  • lua/chadrc.lua file must return a table which follows the structure of nvconfig.
---@type ChadrcConfig
local M = {}

M.ui = {
  theme = "onedark"
}

return M

Install plugin

  • Base46 just compiles your theme + settings into bytecode , so its not a startup plugin.
{ "nvim-lua/plenary.nvim", lazy = true },

{
    "NvChad/base46",
    lazy = true,
    build = function()
      require("base46").load_all_highlights()
    end,
},

-- if u want nvchad's ui plugin :)
{
    "NvChad/ui",
    config = function()
      require "nvchad"
    end,
},

-- dependency for ui 
{
    "nvim-tree/nvim-web-devicons",
    lazy = true,
    opts = function()
      return { override = require "nvchad.icons.devicons" }
    end,
    config = function(_, opts)
      dofile(vim.g.base46_cache .. "devicons")
      require("nvim-web-devicons").setup(opts)
    end,
  },
  • Load cache file by dofile function ( add this in your startup )
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require('base46').load_all_highlights() -- this compiles + loads hl
  • You can load all cache files at once instead of lazyloding them
for _, v in ipairs(vim.fn.readdir(vim.g.base46_cache)) do
  dofile(vim.g.base46_cache .. v)
end
@scarin
Copy link

scarin commented Mar 22, 2024

@scarin i literally showed a video, idk what you need instructions for, you dont even post any error, are you even running the dofile functions*? those are needed to load the cache files

OMG, I did it! After carefully checking the code, I realized that the base64 encoding never compiled successfully. Thank you for your help.

@siduck
Copy link
Author

siduck commented Mar 22, 2024

@scarin i literally showed a video, idk what you need instructions for, you dont even post any error, are you even running the dofile functions*? those are needed to load the cache files

OMG, I did it! After carefully checking the code, I realized that the base64 encoding never compiled successfully. Thank you for your help.

yea it compiles during the build phase of lazy.nvim

@DebXD
Copy link

DebXD commented Jun 15, 2024

@scarin i literally showed a video, idk what you need instructions for, you dont even post any error, are you even running the dofile functions*? those are needed to load the cache files

OMG, I did it! After carefully checking the code, I realized that the base64 encoding never compiled successfully. Thank you for your help.

yea it compiles during the build phase of lazy.nvim

Mine is getting build error for cmp_ui, but I am not using any ui just the base.
Sat Jun 15 10:29:34 AM IST 2024

@siduck
Copy link
Author

siduck commented Jun 15, 2024

@DebXD i hope you have copied all of nvconfig :)

image

@Pesky01
Copy link

Pesky01 commented Jun 27, 2024

nvconfig file no longer exists, do I just steal it from an old commit or is there another way to do it?

@siduck
Copy link
Author

siduck commented Jun 28, 2024

@Pesky01 chadrc is the file now, updated the guide!

btw this guide's temporary, will soon add actual help docs for the ui/base46 plugin detailing every single feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment