Skip to content

Commit

Permalink
Added light theme for vim and lsd linux and darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-pmillz committed Jul 6, 2022
1 parent b2db23d commit bdcb814
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 5 deletions.
63 changes: 62 additions & 1 deletion extra/extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,37 @@ func InstallExtraPackages(osType string, dirs *localio.Directories, packages *lo
if err := localio.BrewInstallProgram("lsd", "lsd", packages); err != nil {
return err
}
// install cowsay because it's Pimpin'
// create lsd config, light and dark themes
if err := os.MkdirAll(fmt.Sprintf("%s/.config/lsd/themes", dirs.HomeDir), 0750); err != nil {
return err
}
lsdConfig, err := extraConfigs.Open("templates/lsd_config.yaml")
if err != nil {
return err
}
exists, err := localio.Exists("~/.config/lsd/config.yaml")
if err == nil && !exists {
if err = localio.EmbedFileCopy("~/.config/lsd/config.yaml", lsdConfig); err != nil {
return err
}
}

lsdDarkTheme, err := extraConfigs.Open("templates/lsd_default_theme.yaml")
if err != nil {
return err
}
if err = localio.EmbedFileCopy("~/.config/lsd/themes/default.yaml", lsdDarkTheme); err != nil {
return err
}

lsdLightTheme, err := extraConfigs.Open("templates/lsd_light_theme.yaml")
if err != nil {
return err
}
if err = localio.EmbedFileCopy("~/.config/lsd/themes/light.yaml", lsdLightTheme); err != nil {
return err
}
// install cowsay
if err := localio.BrewInstallProgram("cowsay", "cowsay", packages); err != nil {
return err
}
Expand Down Expand Up @@ -102,6 +132,37 @@ func InstallExtraPackages(osType string, dirs *localio.Directories, packages *lo
return err
}
}
// create lsd config, light and dark themes
if err := os.MkdirAll(fmt.Sprintf("%s/.config/lsd/themes", dirs.HomeDir), 0750); err != nil {
return err
}
lsdConfig, err := extraConfigs.Open("templates/lsd_config.yaml")
if err != nil {
return err
}
exists, err := localio.Exists("~/.config/lsd/config.yaml")
if err == nil && !exists {
if err = localio.EmbedFileCopy("~/.config/lsd/config.yaml", lsdConfig); err != nil {
return err
}
}

lsdDarkTheme, err := extraConfigs.Open("templates/lsd_default_theme.yaml")
if err != nil {
return err
}
if err = localio.EmbedFileCopy("~/.config/lsd/themes/default.yaml", lsdDarkTheme); err != nil {
return err
}

lsdLightTheme, err := extraConfigs.Open("templates/lsd_light_theme.yaml")
if err != nil {
return err
}
if err = localio.EmbedFileCopy("~/.config/lsd/themes/light.yaml", lsdLightTheme); err != nil {
return err
}

// install cowsay, bat, fd-find
if err := localio.AptInstall(packages, "cowsay", "bat", "fd-find"); err != nil {
return err
Expand Down
139 changes: 139 additions & 0 deletions extra/templates/lsd_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# == Classic ==
# This is a shorthand to override some of the options to be backwards compatible
# with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date"
# and "icons"->"when" options.
# Possible values: false, true
classic: false

# == Blocks ==
# This specifies the columns and their order when using the long and the tree
# layout.
# Possible values: permission, user, group, size, size_value, date, name, inode
blocks:
- permission
- user
- group
- size
- date
- name

# == Color ==
# This has various color options. (Will be expanded in the future.)
color:
# When to colorize the output.
# When "classic" is set, this is set to "never".
# Possible values: never, auto, always
when: auto
# How to colorize the output.
# When "classic" is set, this is set to "no-color".
# Possible values: default, <theme-file-name>
# when specifying <theme-file-name>, lsd will look up theme file
# XDG Base Directory if relative, e.g. ~/.config/lsd/themes/<theme-file-name>.yaml,
# The file path if absolute
# For dark themes, use default
theme: default
# For light themes, use light theme in ~/.config/lsd/themes/light.yaml
# theme: light

# == Date ==
# This specifies the date format for the date column. The freeform format
# accepts an strftime like string.
# When "classic" is set, this is set to "date".
# Possible values: date, relative, '+<date_format>'
# `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
date: date

# == Dereference ==
# Whether to dereference symbolic links.
# Possible values: false, true
dereference: false

# == Display ==
# What items to display. Do not specify this for the default behavior.
# Possible values: all, almost-all, directory-only
# display: all

# == Icons ==
icons:
# When to use icons.
# When "classic" is set, this is set to "never".
# Possible values: always, auto, never
when: auto
# Which icon theme to use.
# Possible values: fancy, unicode
theme: fancy
# Separator between icon and the name
# Default to 1 space
separator: " "

# == Ignore Globs ==
# A list of globs to ignore when listing.
# ignore-globs:
# - .git

# == Indicators ==
# Whether to add indicator characters to certain listed files.
# Possible values: false, true
indicators: false

# == Layout ==
# Which layout to use. "oneline" might be a bit confusing here and should be
# called "one-per-line". It might be changed in the future.
# Possible values: grid, tree, oneline
layout: grid

# == Recursion ==
recursion:
# Whether to enable recursion.
# Possible values: false, true
enabled: false
# How deep the recursion should go. This has to be a positive integer. Leave
# it unspecified for (virtually) infinite.
# depth: 3

# == Size ==
# Specifies the format of the size column.
# Possible values: default, short, bytes
size: default

# == Permission ==
# Specify the format of the permission column
# Possible value: rwx, octal
# permission: rwx

# == Sorting ==
sorting:
# Specify what to sort by.
# Possible values: extension, name, time, size, version
column: name
# Whether to reverse the sorting.
# Possible values: false, true
reverse: false
# Whether to group directories together and where.
# When "classic" is set, this is set to "none".
# Possible values: first, last, none
dir-grouping: none

# == No Symlink ==
# Whether to omit showing symlink targets
# Possible values: false, true
no-symlink: false

# == Total size ==
# Whether to display the total size of directories.
# Possible values: false, true
total-size: false

# == Hyperlink ==
# Attach hyperlink to filenames
# Possible values: always, auto, never
# hyperlink: never

# == Symlink arrow ==
# Specifies how the symlink arrow display, chars in both ascii and utf8
symlink-arrow:

# == Header ==
# Whether to display block headers.
# Possible values: false, true
# header: false
27 changes: 27 additions & 0 deletions extra/templates/lsd_default_theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
user: 230
group: 187
permission:
read: dark_green
write: dark_yellow
exec: dark_red
exec-sticky: 5
no-access: 245
octal: 6
acl: dark_cyan
context: cyan
date:
hour-old: 40
day-old: 42
older: 36
size:
none: 245
small: 229
medium: 216
large: 172
inode:
valid: 13
invalid: 245
links:
valid: 13
invalid: 245
tree-edge: 245
27 changes: 27 additions & 0 deletions extra/templates/lsd_light_theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
user: 0
group: 0
permission:
read: dark_green
write: dark_yellow
exec: dark_red
exec-sticky: 5
no-access: 245
octal: 6
acl: dark_cyan
context: cyan
date:
hour-old: 40
day-old: 42
older: 36
size:
none: 250
small: 245
medium: 0
large: 0
inode:
valid: 13
invalid: 245
links:
valid: 13
invalid: 245
tree-edge: 245
4 changes: 4 additions & 0 deletions vim/templates/darwin/my_configs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ try
syntax enable
filetype plugin indent on
"Set Dracula to the default Theme
" For Light mode, switch to peaksea and set background=light
color dracula
" color peaksea
let g:dracula_colorterm = 0
let g:dracula_italic = 0
" Show Line Numbers
set nu
" Set Background to dark mode
" For Light mode, switch to color to peaksea and set background=light
" set background=light
set background=dark

" disable autopairs
Expand Down
19 changes: 15 additions & 4 deletions vim/templates/linux/my_configs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ try
syntax enable
filetype plugin indent on
"Set Dracula to the default Theme
" For Light mode, switch to peaksea and set background=light
color dracula
" color peaksea
let g:dracula_colorterm = 0
let g:dracula_italic = 0
" Show Line Numbers
set nu
" Set Background to dark mode
" For Light mode, switch to color to peaksea and set background=light
" set background=light
set background=dark

" disable autopairs
Expand Down Expand Up @@ -113,12 +117,19 @@ try

" prevent vim from hiding quotes in json files
let g:vim_json_conceal=0

" disable folding
set nofoldenable

" Fix indentLine plugin for markdown backticks and invisible chars
let g:indentLine_fileTypeExclude = ['markdown']
" Fix indentLine plugin for markdown backticks and invisible chars
let g:indentLine_fileTypeExclude = ['markdown']

" Disable Markdown concealing
set conceallevel=0
let g:tex_conceal = ""
let g:vim_markdown_math = 1
let g:vim_markdown_conceal = 0
let g:vim_markdown_conceal_code_blocks = 0

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

0 comments on commit bdcb814

Please sign in to comment.