Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit bdcb814

Browse files
author
mr-pmillz
committed
Added light theme for vim and lsd linux and darwin
1 parent b2db23d commit bdcb814

File tree

6 files changed

+274
-5
lines changed

6 files changed

+274
-5
lines changed

extra/extra.go

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,37 @@ func InstallExtraPackages(osType string, dirs *localio.Directories, packages *lo
2424
if err := localio.BrewInstallProgram("lsd", "lsd", packages); err != nil {
2525
return err
2626
}
27-
// install cowsay because it's Pimpin'
27+
// create lsd config, light and dark themes
28+
if err := os.MkdirAll(fmt.Sprintf("%s/.config/lsd/themes", dirs.HomeDir), 0750); err != nil {
29+
return err
30+
}
31+
lsdConfig, err := extraConfigs.Open("templates/lsd_config.yaml")
32+
if err != nil {
33+
return err
34+
}
35+
exists, err := localio.Exists("~/.config/lsd/config.yaml")
36+
if err == nil && !exists {
37+
if err = localio.EmbedFileCopy("~/.config/lsd/config.yaml", lsdConfig); err != nil {
38+
return err
39+
}
40+
}
41+
42+
lsdDarkTheme, err := extraConfigs.Open("templates/lsd_default_theme.yaml")
43+
if err != nil {
44+
return err
45+
}
46+
if err = localio.EmbedFileCopy("~/.config/lsd/themes/default.yaml", lsdDarkTheme); err != nil {
47+
return err
48+
}
49+
50+
lsdLightTheme, err := extraConfigs.Open("templates/lsd_light_theme.yaml")
51+
if err != nil {
52+
return err
53+
}
54+
if err = localio.EmbedFileCopy("~/.config/lsd/themes/light.yaml", lsdLightTheme); err != nil {
55+
return err
56+
}
57+
// install cowsay
2858
if err := localio.BrewInstallProgram("cowsay", "cowsay", packages); err != nil {
2959
return err
3060
}
@@ -102,6 +132,37 @@ func InstallExtraPackages(osType string, dirs *localio.Directories, packages *lo
102132
return err
103133
}
104134
}
135+
// create lsd config, light and dark themes
136+
if err := os.MkdirAll(fmt.Sprintf("%s/.config/lsd/themes", dirs.HomeDir), 0750); err != nil {
137+
return err
138+
}
139+
lsdConfig, err := extraConfigs.Open("templates/lsd_config.yaml")
140+
if err != nil {
141+
return err
142+
}
143+
exists, err := localio.Exists("~/.config/lsd/config.yaml")
144+
if err == nil && !exists {
145+
if err = localio.EmbedFileCopy("~/.config/lsd/config.yaml", lsdConfig); err != nil {
146+
return err
147+
}
148+
}
149+
150+
lsdDarkTheme, err := extraConfigs.Open("templates/lsd_default_theme.yaml")
151+
if err != nil {
152+
return err
153+
}
154+
if err = localio.EmbedFileCopy("~/.config/lsd/themes/default.yaml", lsdDarkTheme); err != nil {
155+
return err
156+
}
157+
158+
lsdLightTheme, err := extraConfigs.Open("templates/lsd_light_theme.yaml")
159+
if err != nil {
160+
return err
161+
}
162+
if err = localio.EmbedFileCopy("~/.config/lsd/themes/light.yaml", lsdLightTheme); err != nil {
163+
return err
164+
}
165+
105166
// install cowsay, bat, fd-find
106167
if err := localio.AptInstall(packages, "cowsay", "bat", "fd-find"); err != nil {
107168
return err

extra/templates/lsd_config.yaml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# == Classic ==
2+
# This is a shorthand to override some of the options to be backwards compatible
3+
# with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date"
4+
# and "icons"->"when" options.
5+
# Possible values: false, true
6+
classic: false
7+
8+
# == Blocks ==
9+
# This specifies the columns and their order when using the long and the tree
10+
# layout.
11+
# Possible values: permission, user, group, size, size_value, date, name, inode
12+
blocks:
13+
- permission
14+
- user
15+
- group
16+
- size
17+
- date
18+
- name
19+
20+
# == Color ==
21+
# This has various color options. (Will be expanded in the future.)
22+
color:
23+
# When to colorize the output.
24+
# When "classic" is set, this is set to "never".
25+
# Possible values: never, auto, always
26+
when: auto
27+
# How to colorize the output.
28+
# When "classic" is set, this is set to "no-color".
29+
# Possible values: default, <theme-file-name>
30+
# when specifying <theme-file-name>, lsd will look up theme file
31+
# XDG Base Directory if relative, e.g. ~/.config/lsd/themes/<theme-file-name>.yaml,
32+
# The file path if absolute
33+
# For dark themes, use default
34+
theme: default
35+
# For light themes, use light theme in ~/.config/lsd/themes/light.yaml
36+
# theme: light
37+
38+
# == Date ==
39+
# This specifies the date format for the date column. The freeform format
40+
# accepts an strftime like string.
41+
# When "classic" is set, this is set to "date".
42+
# Possible values: date, relative, '+<date_format>'
43+
# `date_format` will be a `strftime` formatted value. e.g. `date: '+%d %b %y %X'` will give you a date like this: 17 Jun 21 20:14:55
44+
date: date
45+
46+
# == Dereference ==
47+
# Whether to dereference symbolic links.
48+
# Possible values: false, true
49+
dereference: false
50+
51+
# == Display ==
52+
# What items to display. Do not specify this for the default behavior.
53+
# Possible values: all, almost-all, directory-only
54+
# display: all
55+
56+
# == Icons ==
57+
icons:
58+
# When to use icons.
59+
# When "classic" is set, this is set to "never".
60+
# Possible values: always, auto, never
61+
when: auto
62+
# Which icon theme to use.
63+
# Possible values: fancy, unicode
64+
theme: fancy
65+
# Separator between icon and the name
66+
# Default to 1 space
67+
separator: " "
68+
69+
# == Ignore Globs ==
70+
# A list of globs to ignore when listing.
71+
# ignore-globs:
72+
# - .git
73+
74+
# == Indicators ==
75+
# Whether to add indicator characters to certain listed files.
76+
# Possible values: false, true
77+
indicators: false
78+
79+
# == Layout ==
80+
# Which layout to use. "oneline" might be a bit confusing here and should be
81+
# called "one-per-line". It might be changed in the future.
82+
# Possible values: grid, tree, oneline
83+
layout: grid
84+
85+
# == Recursion ==
86+
recursion:
87+
# Whether to enable recursion.
88+
# Possible values: false, true
89+
enabled: false
90+
# How deep the recursion should go. This has to be a positive integer. Leave
91+
# it unspecified for (virtually) infinite.
92+
# depth: 3
93+
94+
# == Size ==
95+
# Specifies the format of the size column.
96+
# Possible values: default, short, bytes
97+
size: default
98+
99+
# == Permission ==
100+
# Specify the format of the permission column
101+
# Possible value: rwx, octal
102+
# permission: rwx
103+
104+
# == Sorting ==
105+
sorting:
106+
# Specify what to sort by.
107+
# Possible values: extension, name, time, size, version
108+
column: name
109+
# Whether to reverse the sorting.
110+
# Possible values: false, true
111+
reverse: false
112+
# Whether to group directories together and where.
113+
# When "classic" is set, this is set to "none".
114+
# Possible values: first, last, none
115+
dir-grouping: none
116+
117+
# == No Symlink ==
118+
# Whether to omit showing symlink targets
119+
# Possible values: false, true
120+
no-symlink: false
121+
122+
# == Total size ==
123+
# Whether to display the total size of directories.
124+
# Possible values: false, true
125+
total-size: false
126+
127+
# == Hyperlink ==
128+
# Attach hyperlink to filenames
129+
# Possible values: always, auto, never
130+
# hyperlink: never
131+
132+
# == Symlink arrow ==
133+
# Specifies how the symlink arrow display, chars in both ascii and utf8
134+
symlink-arrow:
135+
136+
# == Header ==
137+
# Whether to display block headers.
138+
# Possible values: false, true
139+
# header: false
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
user: 230
2+
group: 187
3+
permission:
4+
read: dark_green
5+
write: dark_yellow
6+
exec: dark_red
7+
exec-sticky: 5
8+
no-access: 245
9+
octal: 6
10+
acl: dark_cyan
11+
context: cyan
12+
date:
13+
hour-old: 40
14+
day-old: 42
15+
older: 36
16+
size:
17+
none: 245
18+
small: 229
19+
medium: 216
20+
large: 172
21+
inode:
22+
valid: 13
23+
invalid: 245
24+
links:
25+
valid: 13
26+
invalid: 245
27+
tree-edge: 245

extra/templates/lsd_light_theme.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
user: 0
2+
group: 0
3+
permission:
4+
read: dark_green
5+
write: dark_yellow
6+
exec: dark_red
7+
exec-sticky: 5
8+
no-access: 245
9+
octal: 6
10+
acl: dark_cyan
11+
context: cyan
12+
date:
13+
hour-old: 40
14+
day-old: 42
15+
older: 36
16+
size:
17+
none: 250
18+
small: 245
19+
medium: 0
20+
large: 0
21+
inode:
22+
valid: 13
23+
invalid: 245
24+
links:
25+
valid: 13
26+
invalid: 245
27+
tree-edge: 245

vim/templates/darwin/my_configs.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ try
44
syntax enable
55
filetype plugin indent on
66
"Set Dracula to the default Theme
7+
" For Light mode, switch to peaksea and set background=light
78
color dracula
9+
" color peaksea
810
let g:dracula_colorterm = 0
911
let g:dracula_italic = 0
1012
" Show Line Numbers
1113
set nu
1214
" Set Background to dark mode
15+
" For Light mode, switch to color to peaksea and set background=light
16+
" set background=light
1317
set background=dark
1418

1519
" disable autopairs

vim/templates/linux/my_configs.vim

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ try
44
syntax enable
55
filetype plugin indent on
66
"Set Dracula to the default Theme
7+
" For Light mode, switch to peaksea and set background=light
78
color dracula
9+
" color peaksea
810
let g:dracula_colorterm = 0
911
let g:dracula_italic = 0
1012
" Show Line Numbers
1113
set nu
1214
" Set Background to dark mode
15+
" For Light mode, switch to color to peaksea and set background=light
16+
" set background=light
1317
set background=dark
1418

1519
" disable autopairs
@@ -113,12 +117,19 @@ try
113117

114118
" prevent vim from hiding quotes in json files
115119
let g:vim_json_conceal=0
116-
120+
117121
" disable folding
118122
set nofoldenable
119123

120-
" Fix indentLine plugin for markdown backticks and invisible chars
121-
let g:indentLine_fileTypeExclude = ['markdown']
124+
" Fix indentLine plugin for markdown backticks and invisible chars
125+
let g:indentLine_fileTypeExclude = ['markdown']
126+
127+
" Disable Markdown concealing
128+
set conceallevel=0
129+
let g:tex_conceal = ""
130+
let g:vim_markdown_math = 1
131+
let g:vim_markdown_conceal = 0
132+
let g:vim_markdown_conceal_code_blocks = 0
122133

123134
" Tab hotkeys
124135
map <leader>tb :tabprevious<cr>
@@ -171,4 +182,4 @@ try
171182
" Block vim-multiple-cursors as it is deprecated eol use vim-visual-multi instead
172183
let g:pathogen_blacklist = ['vim-multiple-cursors']
173184
catch
174-
endtry
185+
endtry

0 commit comments

Comments
 (0)