35 lines
978 B
Lua
35 lines
978 B
Lua
function ThemeUpdate()
|
|
local scheme_name = "tokyodark" -- default if unable to parse from file
|
|
local current_theme_file = vim.fn.stdpath("config") .. "/current-theme"
|
|
local ok, theme = pcall(dofile, current_theme_file)
|
|
if ok then
|
|
scheme_name = theme.colorscheme_name
|
|
end
|
|
vim.cmd.colorscheme(scheme_name)
|
|
pcall(dofile, vim.fn.stdpath('config') .. '/lua/theme_transparency.lua')
|
|
end
|
|
|
|
function TmpBuff(split_opt)
|
|
local new_cmd = split_opt or "enew"
|
|
vim.cmd(new_cmd)
|
|
vim.opt_local.buftype = "nofile"
|
|
vim.opt_local.bufhidden = "hide"
|
|
vim.opt_local.swapfile = false
|
|
vim.cmd("file tmp_" .. os.date("%Y%m%d_%H%M%S"))
|
|
end
|
|
|
|
function ReadShellCmd(command)
|
|
vim.cmd("read !" .. command)
|
|
end
|
|
|
|
function ToggleTabsSpaces()
|
|
if vim.opt.expandtab:get() then
|
|
vim.opt.expandtab = false
|
|
print("using actual tabs")
|
|
else
|
|
vim.opt.expandtab = true
|
|
print("using spaces in place of tabs")
|
|
end
|
|
end
|
|
|