From d59f31a62b633bcd791a4b62aeab44f40e78f56e Mon Sep 17 00:00:00 2001 From: Yorick Barbanneauwq Date: Sat, 18 Mar 2023 13:33:42 +0100 Subject: [PATCH] add highlight and chafa packages File preview in vifm --- .../highlight/base16-default-dark.theme | 109 ++++++++++++++++++ files/config/vifm/vifmrc | 3 +- playbook.yml | 2 + 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 files/config/highlight/base16-default-dark.theme diff --git a/files/config/highlight/base16-default-dark.theme b/files/config/highlight/base16-default-dark.theme new file mode 100644 index 0000000..0d0f28b --- /dev/null +++ b/files/config/highlight/base16-default-dark.theme @@ -0,0 +1,109 @@ +--[[ 2018/06/17 | Highlight v3.43 | Lua 5.3 +================================================================================ +Scheme: Base16 "Default Dark" +Author: Chris Kempson (http://chriskempson.com) +License: MIT License +Source: https://github.com/chriskempson/base16-default-schemes +================================================================================ +Converted from YAML by Tristano Ajmone: + + https://github.com/tajmone + https://gitlab.com/tajmone +-------------------------------------------------------------------------------- +For more info on Chris Kempson's Base16, see: + http://chriskempson.com/projects/base16 +------------------------------------------------------------------------------]] +Description = "Base16 Default Dark" +Categories = {"dark", "base16", "lsp"} + +-------------------------------------------------------------------------------- +base00 = "#181818" --> Default Background +base01 = "#282828" --> Lighter Background (Used for status bars) +base02 = "#383838" --> Selection Background +base03 = "#585858" --> Comments, Invisibles, Line Highlighting +base04 = "#b8b8b8" --> Dark Foreground (Used for status bars) +base05 = "#d8d8d8" --> Default Foreground, Caret, Delimiters, Operators +base06 = "#e8e8e8" --> Light Foreground (Not often used) +base07 = "#f8f8f8" --> Light Background (Not often used) +base08 = "#ab4642" --> Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 = "#dc9656" --> Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A = "#f7ca88" --> Classes, Markup Bold, Search Text Background +base0B = "#a1b56c" --> Strings, Inherited Class, Markup Code, Diff Inserted +base0C = "#86c1b9" --> Support, Regular Expressions, Escape Characters, Markup Quotes +base0D = "#7cafc2" --> Functions, Methods, Attribute IDs, Headings +base0E = "#ba8baf" --> Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F = "#a16946" --> Deprecated, Opening/Closing Embedded Language Tags, e.g. +-------------------------------------------------------------------------------- +Canvas = { Colour = base00, Italic = false, Bold = false } + +Default = { Colour = base05, Italic = false, Bold = false } + +Number = { Colour = base09, Italic = false, Bold = false } + +Operator = { Colour = base05, Italic = false, Bold = false } + +String = { Colour = base0B, Italic = false, Bold = false } + +Escape = { Colour = base0C, Italic = false, Bold = false } +StringPreProc = Escape + +Interpolation = { Colour = base09, Italic = false, Bold = false } + +LineComment = { Colour = base03, Italic = true, Bold = false } --> Italic +BlockComment = LineComment + +LineNum = { Colour = base04, Italic = false, Bold = false } + +PreProcessor = { Colour = base0F, Italic = false, Bold = false } + +Keywords = { + { Colour = base0E, Italic = false, Bold = true }, --> kwd 1 + { Colour = base0D, Italic = false, Bold = true }, --> kwd 2 + { Colour = base08, Italic = false, Bold = true }, --> kwd 3 + { Colour = base0A, Italic = false, Bold = true }, --> kwd 4 + { Colour = base0F, Italic = false, Bold = true }, --> kwd 5 + { Colour = base09, Italic = false, Bold = true }, --> kwd 6 +} + +-- new LSP based elements: + +SemanticTokenTypes = { + { Type = 'type', Style = Keywords[2] }, + { Type = 'class', Style = { Colour = base0A } }, + { Type = 'struct', Style = { Colour = base0A } }, + { Type = 'interface', Style = { Colour = base06 } }, + { Type = 'parameter', Style = Keywords[6] }, + { Type = 'variable', Style = Keywords[5] }, + { Type = 'enumMember', Style = Keywords[5] }, + { Type = 'function', Style = Keywords[4] }, + { Type = 'method', Style = Keywords[4] }, + { Type = 'keyword', Style = Keywords[1]}, + { Type = 'number', Style = Number }, + { Type = 'regexp', Style = String }, + { Type = 'operator', Style = Operator }, +} + +--[[---------------------------------------------------------------------------- +The MIT License + +Copyright (c) 2018 Tristano Ajmone +Copyright (c) Chris Kempson (http://chriskempson.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------]] diff --git a/files/config/vifm/vifmrc b/files/config/vifm/vifmrc index b7249cb..233ced4 100644 --- a/files/config/vifm/vifmrc +++ b/files/config/vifm/vifmrc @@ -193,7 +193,8 @@ fileviewer {*.tar}, tar -tf %c fileviewer {*.rar}, unrar v %c fileviewer {*.7z}, 7z l %c -fileviewer highlight -O xterm256 -s base16/default-dark %c +fileviewer highlight -O xterm256 + \ --config ~/.config/highlight/base16-default-dark.theme %c filetype * xdg-open " Customize view columns a bit (enable ellipsis for truncated file names) set viewcolumns=-{name}..,6{}. diff --git a/playbook.yml b/playbook.yml index eeeda4a..39dd871 100644 --- a/playbook.yml +++ b/playbook.yml @@ -120,11 +120,13 @@ pkg: - papirus-icon-theme - brightnessctl + - chafa - firefox - foot - foot-terminfo - fzf - g++ + - hightlight - hugo - npm - mpv