Skip to content

Commit

Permalink
fix: set nvim terminal colors to match kitty (#51)
Browse files Browse the repository at this point in the history
closed #49
  • Loading branch information
mikesmithgh authored Nov 10, 2023
1 parent 872d485 commit 0971ab0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lua/kitty-scrollback/configs/example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ return {
}
end,
[prefix .. 'highlight_overrides'] = function()
for i = 0, 15 do
vim.g['terminal_color_' .. i] = 'Cyan'
end
return {
highlight_overrides = {
KittyScrollbackNvimNormal = {
Expand Down
7 changes: 6 additions & 1 deletion lua/kitty-scrollback/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ M.get_highlights_as_env = function()
return env
end

---Set nvim default highlights
---Set nvim default highlights and terminal colors
M.set_highlights = function()
-- set highlight groups
local overrides = opts.highlight_overrides or {}
for name, definition in pairs(highlight_definitions()) do
vim.api.nvim_set_hl(0, name, definition)
Expand All @@ -157,6 +158,10 @@ M.set_highlights = function()
vim.api.nvim_set_hl(0, name, override)
end
end
-- set terminal colors (see :help terminal-config)
for i = 0, 15 do
vim.b['terminal_color_' .. i] = p.kitty_colors['color' .. i]
end
end

return M

0 comments on commit 0971ab0

Please sign in to comment.