nvim/colors/export-kitty-colors.lua
Simon Lasbrugnas 1a97a8ee59
chore: update colorscheme
* Add export-kitty-colors.lua scripts to colors folder
Exports the current colorscheme to a kitty color scheme

* Modify peel-enhanced.vim theme

* Add lsp signature help
2024-09-19 01:53:39 +02:00

29 lines
1 KiB
Lua

-- Export current colorscheme to kitty config format
function ExportColorsKitty()
local fn = vim.fn
local filename = os.getenv("HOME") .. "/.config/kitty/nvim_export.conf"
local file = io.open(filename, "w")
io.output(file)
io.write("# vim:ft=kitty" .. "\n\n")
io.write("# exported from " .. vim.g.colors_name .. "\n\n")
local fg = fn.synIDattr(fn.hlID("Normal"), "fg")
local bg = fn.synIDattr(fn.hlID("Normal"), "bg")
io.write("foreground " .. fg .. "\n")
io.write("background " .. bg .. "\n")
io.write("selection_foreground " .. bg .. "\n")
io.write("selection_background " .. fg .. "\n")
for i = 0,15 do
local var = "g:terminal_color_" .. tostring(i)
if fn.exists(var) == 1 then
local tc = fn.eval(var)
io.write("color" .. tostring(i) .. " " .. tc .. "\n")
if i == 2 then
io.write("cursor " .. tc .. "\n")
end
end
end
io.close(file)
print("Colors exported to " .. filename)
end
ExportColorsKitty()