From bdcb814e7b57bf90e4443119ed548091f9c5a301 Mon Sep 17 00:00:00 2001 From: mr-pmillz <> Date: Wed, 6 Jul 2022 13:27:50 -0400 Subject: [PATCH] Added light theme for vim and lsd linux and darwin --- extra/extra.go | 63 ++++++++++- extra/templates/lsd_config.yaml | 139 +++++++++++++++++++++++++ extra/templates/lsd_default_theme.yaml | 27 +++++ extra/templates/lsd_light_theme.yaml | 27 +++++ vim/templates/darwin/my_configs.vim | 4 + vim/templates/linux/my_configs.vim | 19 +++- 6 files changed, 274 insertions(+), 5 deletions(-) create mode 100644 extra/templates/lsd_config.yaml create mode 100644 extra/templates/lsd_default_theme.yaml create mode 100644 extra/templates/lsd_light_theme.yaml diff --git a/extra/extra.go b/extra/extra.go index f1f7e40..320c81c 100644 --- a/extra/extra.go +++ b/extra/extra.go @@ -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 } @@ -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 diff --git a/extra/templates/lsd_config.yaml b/extra/templates/lsd_config.yaml new file mode 100644 index 0000000..8f1de8c --- /dev/null +++ b/extra/templates/lsd_config.yaml @@ -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, + # when specifying , lsd will look up theme file + # XDG Base Directory if relative, e.g. ~/.config/lsd/themes/.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` 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 \ No newline at end of file diff --git a/extra/templates/lsd_default_theme.yaml b/extra/templates/lsd_default_theme.yaml new file mode 100644 index 0000000..8865f63 --- /dev/null +++ b/extra/templates/lsd_default_theme.yaml @@ -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 \ No newline at end of file diff --git a/extra/templates/lsd_light_theme.yaml b/extra/templates/lsd_light_theme.yaml new file mode 100644 index 0000000..0f74ce1 --- /dev/null +++ b/extra/templates/lsd_light_theme.yaml @@ -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 \ No newline at end of file diff --git a/vim/templates/darwin/my_configs.vim b/vim/templates/darwin/my_configs.vim index e509de3..9105817 100644 --- a/vim/templates/darwin/my_configs.vim +++ b/vim/templates/darwin/my_configs.vim @@ -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 diff --git a/vim/templates/linux/my_configs.vim b/vim/templates/linux/my_configs.vim index 71559da..933796b 100644 --- a/vim/templates/linux/my_configs.vim +++ b/vim/templates/linux/my_configs.vim @@ -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 @@ -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 tb :tabprevious @@ -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 \ No newline at end of file