Refactor the entire configuration
With the release of the Nvidia 555 beta drivers and their improvements to the Wayland experience I've finally decided to return to NixOS with Hyprland again after 2 years of running Gentoo and Opensuse Tumbleweed on X11. So this is me committing the work done so far from the last couple of days. Future commits will be more incremental.
This commit is contained in:
parent
97c86fb014
commit
75b13ac379
72 changed files with 2045 additions and 196 deletions
27
users/hu/packages/nvim/config/lua/util/require_dir.lua
Normal file
27
users/hu/packages/nvim/config/lua/util/require_dir.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
return function(dir, skip_init)
|
||||
local returns = {}
|
||||
local lua_files = vim.split(vim.fn.glob(dir.."/*.lua"), "\n")
|
||||
local namespace = string.gsub(dir, vim.fn.stdpath("config").."/lua/", "")
|
||||
namespace = string.gsub(namespace, "%/", ".")
|
||||
|
||||
for _, file in ipairs(lua_files) do
|
||||
file = string.gsub(file, "%.lua", "")
|
||||
file = string.gsub(file, dir.."/", namespace)
|
||||
|
||||
if skip_init and file == namespace.."init" then
|
||||
goto continue
|
||||
end
|
||||
|
||||
local require_ok, require_return = pcall(require, file)
|
||||
if require_ok then
|
||||
table.insert(returns, require_return)
|
||||
else
|
||||
vim.notify("Could not require file: '"..file.."': "..require_return, vim.log.levels.WARNING)
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
|
||||
return returns
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue