Skip to content

Commit 98313e9

Browse files
committed
feat(extras): add Fish themes
1 parent ff1c5a0 commit 98313e9

File tree

3 files changed

+102
-0
lines changed

3 files changed

+102
-0
lines changed

lua/astrotheme/extras/fish.lua

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
local util = require "astrotheme.extras"
2+
3+
local M = {}
4+
5+
--- @param colors AstroThemePalette
6+
function M.generate(colors)
7+
local function normalize_colors(_colors)
8+
local new_colors = {}
9+
for k, v in pairs(_colors) do
10+
new_colors[k] = type(v) == "string" and v:gsub("^#", "") or normalize_colors(v)
11+
end
12+
return new_colors
13+
end
14+
return util.template(
15+
[[
16+
# ${_style_name} Color Palette
17+
set -l foreground ${syntax.text}
18+
set -l selection ${ui.selection}
19+
set -l comment ${syntax.comment}
20+
set -l red ${syntax.red}
21+
set -l orange ${syntax.orange}
22+
set -l yellow ${syntax.yellow}
23+
set -l green ${syntax.green}
24+
set -l purple ${syntax.purple}
25+
set -l cyan ${syntax.cyan}
26+
set -l pink ${syntax.purple}
27+
28+
# Syntax Highlighting Colors
29+
set -g fish_color_normal $foreground
30+
set -g fish_color_command $cyan
31+
set -g fish_color_keyword $pink
32+
set -g fish_color_quote $yellow
33+
set -g fish_color_redirection $foreground
34+
set -g fish_color_end $orange
35+
set -g fish_color_error $red
36+
set -g fish_color_param $purple
37+
set -g fish_color_comment $comment
38+
set -g fish_color_selection --background=$selection
39+
set -g fish_color_search_match --background=$selection
40+
set -g fish_color_operator $green
41+
set -g fish_color_escape $pink
42+
set -g fish_color_autosuggestion $comment
43+
44+
# Completion Pager Colors
45+
set -g fish_pager_color_progress $comment
46+
set -g fish_pager_color_prefix $cyan
47+
set -g fish_pager_color_completion $foreground
48+
set -g fish_pager_color_description $comment
49+
set -g fish_pager_color_selected_background --background=$selection
50+
]],
51+
normalize_colors(colors)
52+
)
53+
end
54+
55+
return M
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
local util = require "astrotheme.extras"
2+
3+
local M = {}
4+
5+
--- @param colors AstroThemePalette
6+
function M.generate(colors)
7+
local function normalize_colors(_colors)
8+
local new_colors = {}
9+
for k, v in pairs(_colors) do
10+
new_colors[k] = type(v) == "string" and v:gsub("^#", "") or normalize_colors(v)
11+
end
12+
return new_colors
13+
end
14+
return util.template(
15+
[[
16+
# ${_style_name}
17+
18+
# Syntax Highlighting Colors
19+
fish_color_normal ${syntax.text}
20+
fish_color_command ${syntax.cyan}
21+
fish_color_keyword ${syntax.purple}
22+
fish_color_quote ${syntax.yellow}
23+
fish_color_redirection ${syntax.text}
24+
fish_color_end ${syntax.orange}
25+
fish_color_error ${syntax.red}
26+
fish_color_param ${syntax.purple}
27+
fish_color_comment ${syntax.comment}
28+
fish_color_selection --background=${ui.selection}
29+
fish_color_search_match --background=${ui.selection}
30+
fish_color_operator ${syntax.green}
31+
fish_color_escape ${syntax.purple}
32+
fish_color_autosuggestion ${syntax.comment}
33+
34+
# Completion Pager Colors
35+
fish_pager_color_progress ${syntax.comment}
36+
fish_pager_color_prefix ${syntax.cyan}
37+
fish_pager_color_completion ${syntax.text}
38+
fish_pager_color_description ${syntax.comment}
39+
fish_pager_color_selected_background --background=${ui.selection}
40+
]],
41+
normalize_colors(colors)
42+
)
43+
end
44+
45+
return M

lua/astrotheme/extras/init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ M.extras = {
1515
alacritty = { ext = "toml", url = "https://github.com/alacritty/alacritty", label = "Alacritty" },
1616
delta = { ext = "gitconfig", url = "https://github.com/dandavison/delta", label = "Delta" },
1717
dunst = { ext = "dunstrc", url = "https://dunst-project.org/", label = "Dunst" },
18+
fish = { ext = "fish", url = "https://fishshell.com/docs/current/index.html", label = "Fish" },
19+
fish_themes = { ext = "theme", url = "https://fishshell.com/docs/current/interactive.html#syntax-highlighting", label = "Fish Themes" },
1820
}
1921

2022
function M.setup()

0 commit comments

Comments
 (0)