diff options
author | Squibid <me@zacharyscheiman.com> | 2023-11-24 21:38:31 -0500 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2023-11-24 21:38:31 -0500 |
commit | f35b13d669867209427449840ff0930a732591dc (patch) | |
tree | 3acb658ec5d01f456c49a097d56f736cbfbbfc7d /lua/core/misc.lua | |
parent | ebf9d2d1c4682068f5116f7efc1568ce5adf4f1b (diff) | |
download | nvim-f35b13d669867209427449840ff0930a732591dc.tar.gz nvim-f35b13d669867209427449840ff0930a732591dc.tar.bz2 nvim-f35b13d669867209427449840ff0930a732591dc.zip |
more stuff too lazy to seperate
Diffstat (limited to 'lua/core/misc.lua')
-rw-r--r-- | lua/core/misc.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lua/core/misc.lua b/lua/core/misc.lua new file mode 100644 index 0000000..41cbf93 --- /dev/null +++ b/lua/core/misc.lua @@ -0,0 +1,30 @@ +local M = {} + +M.appid = "Nvim Config" + +function M.colorscheme(name) + vim.cmd('colorscheme '..name) + for k, v in pairs(vim.fn.getcompletion('', 'color')) do + if v == name..'.ext' then + vim.cmd('colorscheme '..name..'.ext') + end + end +end + +function M.include(fn) + if not pcall(require, fn) then + vim.notify('Could not find '..fn, vim.log.levels.WARN, { title = M.appid }) + end +end + +function M.readf(fn) + local f = io.open(fn, "r") + if not f then return nil end + local tab = {} + for l in f:lines() do + table.insert(tab, l) + end + return tab +end + +return M |