more stuff too lazy to seperate

This commit is contained in:
2023-11-24 21:38:31 -05:00
parent ebf9d2d1c4
commit f35b13d669
33 changed files with 488 additions and 246 deletions

30
lua/core/misc.lua Normal file
View File

@ -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