From 3685c241a2adaad70299989d32f67fc5c482ff3c Mon Sep 17 00:00:00 2001 From: typicode Date: Thu, 9 Feb 2023 20:30:07 +0100 Subject: [PATCH] feat(extras): add fish theme format (#306) * feat(extras): move fish colors from script to theme format * move fish themes to fish_themes --- extras/fish_themes/tokyonight_day.theme | 25 ++++++++++++ extras/fish_themes/tokyonight_moon.theme | 25 ++++++++++++ extras/fish_themes/tokyonight_night.theme | 25 ++++++++++++ extras/fish_themes/tokyonight_storm.theme | 25 ++++++++++++ lua/tokyonight/extra/fish_themes.lua | 47 +++++++++++++++++++++++ lua/tokyonight/extra/init.lua | 1 + 6 files changed, 148 insertions(+) create mode 100644 extras/fish_themes/tokyonight_day.theme create mode 100644 extras/fish_themes/tokyonight_moon.theme create mode 100644 extras/fish_themes/tokyonight_night.theme create mode 100644 extras/fish_themes/tokyonight_storm.theme create mode 100644 lua/tokyonight/extra/fish_themes.lua diff --git a/extras/fish_themes/tokyonight_day.theme b/extras/fish_themes/tokyonight_day.theme new file mode 100644 index 0000000..9d4206f --- /dev/null +++ b/extras/fish_themes/tokyonight_day.theme @@ -0,0 +1,25 @@ + # TokyoNight + + # Syntax Highlighting Colors + fish_color_normal 3760bf + fish_color_command 007197 + fish_color_keyword 9854f1 + fish_color_quote 8c6c3e + fish_color_redirection 3760bf + fish_color_end b15c00 + fish_color_error f52a65 + fish_color_param 7847bd + fish_color_comment 848cb5 + fish_color_selection --background=99a7df + fish_color_search_match --background=99a7df + fish_color_operator 587539 + fish_color_escape 9854f1 + fish_color_autosuggestion 848cb5 + + # Completion Pager Colors + fish_pager_color_progress 848cb5 + fish_pager_color_prefix 007197 + fish_pager_color_completion 3760bf + fish_pager_color_description 848cb5 + fish_pager_color_selected_background --background=99a7df + \ No newline at end of file diff --git a/extras/fish_themes/tokyonight_moon.theme b/extras/fish_themes/tokyonight_moon.theme new file mode 100644 index 0000000..99d0c53 --- /dev/null +++ b/extras/fish_themes/tokyonight_moon.theme @@ -0,0 +1,25 @@ + # TokyoNight + + # Syntax Highlighting Colors + fish_color_normal c8d3f5 + fish_color_command 86e1fc + fish_color_keyword c099ff + fish_color_quote ffc777 + fish_color_redirection c8d3f5 + fish_color_end ff966c + fish_color_error ff757f + fish_color_param fca7ea + fish_color_comment 636da6 + fish_color_selection --background=3654a7 + fish_color_search_match --background=3654a7 + fish_color_operator c3e88d + fish_color_escape c099ff + fish_color_autosuggestion 636da6 + + # Completion Pager Colors + fish_pager_color_progress 636da6 + fish_pager_color_prefix 86e1fc + fish_pager_color_completion c8d3f5 + fish_pager_color_description 636da6 + fish_pager_color_selected_background --background=3654a7 + \ No newline at end of file diff --git a/extras/fish_themes/tokyonight_night.theme b/extras/fish_themes/tokyonight_night.theme new file mode 100644 index 0000000..933bb44 --- /dev/null +++ b/extras/fish_themes/tokyonight_night.theme @@ -0,0 +1,25 @@ + # TokyoNight + + # Syntax Highlighting Colors + fish_color_normal c0caf5 + fish_color_command 7dcfff + fish_color_keyword bb9af7 + fish_color_quote e0af68 + fish_color_redirection c0caf5 + fish_color_end ff9e64 + fish_color_error f7768e + fish_color_param 9d7cd8 + fish_color_comment 565f89 + fish_color_selection --background=33467c + fish_color_search_match --background=33467c + fish_color_operator 9ece6a + fish_color_escape bb9af7 + fish_color_autosuggestion 565f89 + + # Completion Pager Colors + fish_pager_color_progress 565f89 + fish_pager_color_prefix 7dcfff + fish_pager_color_completion c0caf5 + fish_pager_color_description 565f89 + fish_pager_color_selected_background --background=33467c + \ No newline at end of file diff --git a/extras/fish_themes/tokyonight_storm.theme b/extras/fish_themes/tokyonight_storm.theme new file mode 100644 index 0000000..62b24dd --- /dev/null +++ b/extras/fish_themes/tokyonight_storm.theme @@ -0,0 +1,25 @@ + # TokyoNight + + # Syntax Highlighting Colors + fish_color_normal c0caf5 + fish_color_command 7dcfff + fish_color_keyword bb9af7 + fish_color_quote e0af68 + fish_color_redirection c0caf5 + fish_color_end ff9e64 + fish_color_error f7768e + fish_color_param 9d7cd8 + fish_color_comment 565f89 + fish_color_selection --background=364a82 + fish_color_search_match --background=364a82 + fish_color_operator 9ece6a + fish_color_escape bb9af7 + fish_color_autosuggestion 565f89 + + # Completion Pager Colors + fish_pager_color_progress 565f89 + fish_pager_color_prefix 7dcfff + fish_pager_color_completion c0caf5 + fish_pager_color_description 565f89 + fish_pager_color_selected_background --background=364a82 + \ No newline at end of file diff --git a/lua/tokyonight/extra/fish_themes.lua b/lua/tokyonight/extra/fish_themes.lua new file mode 100644 index 0000000..bb20184 --- /dev/null +++ b/lua/tokyonight/extra/fish_themes.lua @@ -0,0 +1,47 @@ +local util = require("tokyonight.util") + +local M = {} + +--- @param colors ColorScheme +function M.generate(colors) + local fishColors = {} + for k, v in pairs(colors) do + if type(v) == "string" then + fishColors[k] = v:gsub("^#", "") + end + end + + local fish = util.template( + [[ + # TokyoNight + + # Syntax Highlighting Colors + fish_color_normal ${fg} + fish_color_command ${cyan} + fish_color_keyword ${magenta} + fish_color_quote ${yellow} + fish_color_redirection ${fg} + fish_color_end ${orange} + fish_color_error ${red} + fish_color_param ${purple} + fish_color_comment ${comment} + fish_color_selection --background=${bg_visual} + fish_color_search_match --background=${bg_visual} + fish_color_operator ${green} + fish_color_escape ${magenta} + fish_color_autosuggestion ${comment} + + # Completion Pager Colors + fish_pager_color_progress ${comment} + fish_pager_color_prefix ${cyan} + fish_pager_color_completion ${fg} + fish_pager_color_description ${comment} + fish_pager_color_selected_background --background=${bg_visual} + ]], + fishColors + ) + + return fish +end + +return M diff --git a/lua/tokyonight/extra/init.lua b/lua/tokyonight/extra/init.lua index 0172c39..1644bfc 100644 --- a/lua/tokyonight/extra/init.lua +++ b/lua/tokyonight/extra/init.lua @@ -16,6 +16,7 @@ function M.setup() local extras = { kitty = "conf", fish = "fish", + fish_themes = "theme", alacritty = "yml", wezterm = "toml", tmux = "tmux",