Skip to content

Commit 7715868

Browse files
authored
FEATURE: add term-dark and term-light themes from main nushell (nushell#500)
* add `term-dark` and `term-light` themes from main `nushell` * rename the themes: `{term=>nushell}-{dark,light}`
1 parent ebc1610 commit 7715868

File tree

2 files changed

+166
-0
lines changed

2 files changed

+166
-0
lines changed

themes/themes/nushell-dark.nu

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
export def main [] { return {
2+
# color for nushell primitives
3+
separator: white
4+
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
5+
header: green_bold
6+
empty: blue
7+
# Closures can be used to choose colors for specific values.
8+
# The value (in this case, a bool) is piped into the closure.
9+
bool: {|| if $in { 'light_cyan' } else { 'light_gray' } }
10+
int: white
11+
filesize: {|e|
12+
if $e == 0b {
13+
'white'
14+
} else if $e < 1mb {
15+
'cyan'
16+
} else { 'blue' }
17+
}
18+
duration: white
19+
date: {|| (date now) - $in |
20+
if $in < 1hr {
21+
'purple'
22+
} else if $in < 6hr {
23+
'red'
24+
} else if $in < 1day {
25+
'yellow'
26+
} else if $in < 3day {
27+
'green'
28+
} else if $in < 1wk {
29+
'light_green'
30+
} else if $in < 6wk {
31+
'cyan'
32+
} else if $in < 52wk {
33+
'blue'
34+
} else { 'dark_gray' }
35+
}
36+
range: white
37+
float: white
38+
string: white
39+
nothing: white
40+
binary: white
41+
cellpath: white
42+
row_index: green_bold
43+
record: white
44+
list: white
45+
block: white
46+
hints: dark_gray
47+
48+
shape_and: purple_bold
49+
shape_binary: purple_bold
50+
shape_block: blue_bold
51+
shape_bool: light_cyan
52+
shape_closure: green_bold
53+
shape_custom: green
54+
shape_datetime: cyan_bold
55+
shape_directory: cyan
56+
shape_external: cyan
57+
shape_externalarg: green_bold
58+
shape_filepath: cyan
59+
shape_flag: blue_bold
60+
shape_float: purple_bold
61+
# shapes are used to change the cli syntax highlighting
62+
shape_garbage: { fg: white bg: red attr: b}
63+
shape_globpattern: cyan_bold
64+
shape_int: purple_bold
65+
shape_internalcall: cyan_bold
66+
shape_list: cyan_bold
67+
shape_literal: blue
68+
shape_match_pattern: green
69+
shape_matching_brackets: { attr: u }
70+
shape_nothing: light_cyan
71+
shape_operator: yellow
72+
shape_or: purple_bold
73+
shape_pipe: purple_bold
74+
shape_range: yellow_bold
75+
shape_record: cyan_bold
76+
shape_redirection: purple_bold
77+
shape_signature: green_bold
78+
shape_string: green
79+
shape_string_interpolation: cyan_bold
80+
shape_table: blue_bold
81+
shape_variable: purple
82+
shape_vardecl: purple
83+
}}

themes/themes/nushell-light.nu

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
export def main [] { return {
2+
# color for nushell primitives
3+
separator: dark_gray
4+
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
5+
header: green_bold
6+
empty: blue
7+
# Closures can be used to choose colors for specific values.
8+
# The value (in this case, a bool) is piped into the closure.
9+
bool: {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
10+
int: dark_gray
11+
filesize: {|e|
12+
if $e == 0b {
13+
'dark_gray'
14+
} else if $e < 1mb {
15+
'cyan_bold'
16+
} else { 'blue_bold' }
17+
}
18+
duration: dark_gray
19+
date: {|| (date now) - $in |
20+
if $in < 1hr {
21+
'purple'
22+
} else if $in < 6hr {
23+
'red'
24+
} else if $in < 1day {
25+
'yellow'
26+
} else if $in < 3day {
27+
'green'
28+
} else if $in < 1wk {
29+
'light_green'
30+
} else if $in < 6wk {
31+
'cyan'
32+
} else if $in < 52wk {
33+
'blue'
34+
} else { 'dark_gray' }
35+
}
36+
range: dark_gray
37+
float: dark_gray
38+
string: dark_gray
39+
nothing: dark_gray
40+
binary: dark_gray
41+
cellpath: dark_gray
42+
row_index: green_bold
43+
record: white
44+
list: white
45+
block: white
46+
hints: dark_gray
47+
48+
shape_and: purple_bold
49+
shape_binary: purple_bold
50+
shape_block: blue_bold
51+
shape_bool: light_cyan
52+
shape_closure: green_bold
53+
shape_custom: green
54+
shape_datetime: cyan_bold
55+
shape_directory: cyan
56+
shape_external: cyan
57+
shape_externalarg: green_bold
58+
shape_filepath: cyan
59+
shape_flag: blue_bold
60+
shape_float: purple_bold
61+
# shapes are used to change the cli syntax highlighting
62+
shape_garbage: { fg: white bg: red attr: b}
63+
shape_globpattern: cyan_bold
64+
shape_int: purple_bold
65+
shape_internalcall: cyan_bold
66+
shape_list: cyan_bold
67+
shape_literal: blue
68+
shape_match_pattern: green
69+
shape_matching_brackets: { attr: u }
70+
shape_nothing: light_cyan
71+
shape_operator: yellow
72+
shape_or: purple_bold
73+
shape_pipe: purple_bold
74+
shape_range: yellow_bold
75+
shape_record: cyan_bold
76+
shape_redirection: purple_bold
77+
shape_signature: green_bold
78+
shape_string: green
79+
shape_string_interpolation: cyan_bold
80+
shape_table: blue_bold
81+
shape_variable: purple
82+
shape_vardecl: purple
83+
}}

0 commit comments

Comments
 (0)