Add theme-set/switching logic, and minor nvim, tmux, obsidian changes

This commit is contained in:
2025-10-30 00:03:39 -05:00
parent f8bb7bbf03
commit bd5cb81499
55 changed files with 716 additions and 182 deletions

View File

@@ -0,0 +1,34 @@
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