diff --git a/lua/lualine/utils/loader.lua b/lua/lualine/utils/loader.lua index 717ee2d..3eba13b 100644 --- a/lua/lualine/utils/loader.lua +++ b/lua/lualine/utils/loader.lua @@ -226,6 +226,11 @@ local function load_theme(theme_name) -- when only one is found run that and return it's return value retval = dofile(files[1]) else + -- put entries from user config path in front + local user_config_path = vim.fn.stdpath('config') + table.sort(files, function(a, b) + return vim.startswith(a, user_config_path) or not vim.startswith(b, user_config_path) + end) -- More then 1 found . Use the first one that isn't in lualines repo local lualine_repo_pattern = table.concat({ 'lualine.nvim', 'lua', 'lualine' }, sep) local file_found = false diff --git a/lua/lualine_require.lua b/lua/lualine_require.lua index c8aad79..f315728 100644 --- a/lua/lualine_require.lua +++ b/lua/lualine_require.lua @@ -60,6 +60,11 @@ function M.require(module) paths = vim.api.nvim_get_runtime_file(pattern_path, false) end if #paths > 0 then + -- put entries from user config path in front + local user_config_path = vim.fn.stdpath('config') + table.sort(paths, function(a, b) + return vim.startswith(a, user_config_path) or not vim.startswith(b, user_config_path) + end) local mod_result = dofile(paths[1]) package.loaded[module] = mod_result return mod_result