diff options
Diffstat (limited to 'lua/user/utils.lua')
| -rw-r--r-- | lua/user/utils.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/user/utils.lua b/lua/user/utils.lua index 3c6f89e..bfb5faa 100644 --- a/lua/user/utils.lua +++ b/lua/user/utils.lua @@ -31,6 +31,15 @@ function M.may_create_dir(dir) end end +M['unload_lua_namespace'] = function(prefix) + local prefix_with_dot = prefix .. '.' + for key, value in pairs(package.loaded) do + if key == prefix or key:sub(1, #prefix_with_dot) == prefix_with_dot then + package.loaded[key] = nil + end + end +end + -- toggle cmp completion vim.g.cmp_toggle_flag = false -- initialize local normal_buftype = function() |
