diff --git a/.gitignore b/.gitignore index 11270fb..70a8c56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ test notes.md +lua/startup/themes/custom diff --git a/lua/startup/utils.lua b/lua/startup/utils.lua index 9b875f6..f10ae18 100644 --- a/lua/startup/utils.lua +++ b/lua/startup/utils.lua @@ -94,7 +94,11 @@ function U.load_theme(theme_name) local files = vim.api.nvim_get_runtime_file(path, true) local settings if #files == 0 then - path = "lua/startup/themes" .. theme_name .. "/init.lua" + path = "lua/startup/themes/" .. theme_name .. "/init.lua" + files = vim.api.nvim_get_runtime_file(path, true) + end + if #files == 0 then + path = "lua/startup/themes/custom/" .. theme_name .. ".lua" files = vim.api.nvim_get_runtime_file(path, true) end if #files == 0 then diff --git a/readme.md b/readme.md index 17de837..8123d34 100644 --- a/readme.md +++ b/readme.md @@ -281,8 +281,9 @@ The evil theme is just a bloated theme with oldfiles, commands, additional info ### Custom theme -You can put your theme in `lua/startup/themes/my_theme.lua` +You can put your theme in `lua/startup/themes/my_theme.lua` or you can make directory in `lua/startup/themes/custom` and put your themes there to keep them untracked by git. The file has to return settings with the structure like you put them into `setup()`. + You can also overwrite a theme (e.g. `dashboard`). Just copy all the setting from it and change whatever you want. You can use some functions from `lua/startup/functions.lua` with `require("startup.functions").function_name()`.