tinted-theming / base16-kakoune

Base16 themes for Kakoune
MIT License
5 stars 0 forks source link

[Feature request] Update template to support kakoune tree sitter and kak lsp semantic highlighting #3

Closed mchalupiak closed 1 month ago

mchalupiak commented 2 months ago

Better syntax highlighting is provided by kakoune tree sitter and kak lsp, in a similar way to neovim treesitter. Updating the template used to generate the base16 themes to take advantage of the added faces would greatly improve syntax highlighting without interfering with highlighting for those who don't use these plugins. Information on the added faces can be found here and here Here is the altered template I have been using, which uses tree sitter highlighting (it can be improved)

declare-option str base00 'rgb:{{base00-hex}}'# black2
declare-option str base01 'rgb:{{base01-hex}}'# black1
declare-option str base02 'rgb:{{base02-hex}}'# black3
declare-option str base03 'rgb:{{base03-hex}}'# flamingo
declare-option str base04 'rgb:{{base04-hex}}'# grey0
declare-option str base05 'rgb:{{base05-hex}}'# white
declare-option str base06 'rgb:{{base06-hex}}'# rosewater
declare-option str base07 'rgb:{{base07-hex}}'# lavender
declare-option str base08 'rgb:{{base08-hex}}'# red
declare-option str base09 'rgb:{{base09-hex}}'# orange
declare-option str base0A 'rgb:{{base0A-hex}}'# yellow
declare-option str base0B 'rgb:{{base0B-hex}}'# green
declare-option str base0C 'rgb:{{base0C-hex}}'# teal
declare-option str base0D 'rgb:{{base0D-hex}}'# blue
declare-option str base0E 'rgb:{{base0E-hex}}'# mauve
declare-option str base0F 'rgb:{{base0F-hex}}'# flamingo

set-face global value "%opt{base09}"
set-face global type "%opt{base08}"
set-face global variable "%opt{base08}"
set-face global module "%opt{base0D}"
set-face global function "%opt{base0D}"
set-face global identifier "%opt{base08}"
set-face global string "%opt{base0B}"
set-face global error "%opt{base08}"
set-face global keyword "%opt{base0E}"
set-face global operator "%opt{base05}"
set-face global attribute "%opt{base09}"
set-face global bracket "%opt{base05}+b"
set-face global arguement "%opt{base09}"
set-face global comma "%opt{base05}"
set-face global constant "%opt{base09}+b"
set-face global comment "%opt{base03}+i"
set-face global documentation "%opt{base03}+i"
set-face global docstring "%opt{base03}+i"
set-face global docstring "%opt{base0A}"
set-face global meta "%opt{base0C}"
set-face global builtin "%opt{base0C}+b"

set-face global title "%opt{base0E}"
set-face global header "%opt{base0D}"
set-face global bold "%opt{base0E}"
set-face global italic "%opt{base0E}"
set-face global mono "%opt{base0B}"
set-face global block "%opt{base0D}"
set-face global link "%opt{base0B}"
set-face global bullet "%opt{base0B}"
set-face global list "%opt{base05}"

set-face global Default "%opt{base05},%opt{base00}"
set-face global PrimarySelection "%opt{base00},%opt{base0A}"
set-face global SecondarySelection "%opt{base03},%opt{base0A}"
set-face global PrimaryCursor "%opt{base00},%opt{base05}"
set-face global SecondaryCursor "%opt{base00},%opt{base0C}"
set-face global PrimaryCursorEol "%opt{base00},%opt{base0A}"
set-face global SecondaryCursorEol "%opt{base00},%opt{base0D}"
set-face global LineNumbers "%opt{base04},%opt{base00}"
set-face global LineNumberCursor "%opt{base0A},%opt{base00}+b"
set-face global LineNumbersWrapped "%opt{base04},%opt{base00}+i"
set-face global MenuForeground "%opt{base06},%opt{base01}+b"
set-face global MenuBackground "%opt{base0D},%opt{base07}"
set-face global MenuInfo "%opt{base0D},%opt{base07}"
set-face global Information "%opt{base01},%opt{base07}"
set-face global Error "%opt{base01},%opt{base08}"
set-face global DiagnosticError "%opt{base08}"
set-face global DiagnosticWarning "%opt{base0A}"
set-face global StatusLine "%opt{base04},%opt{base02}"
set-face global StatusLineMode "%opt{base0A},%opt{base02}"
set-face global StatusLineInfo "%opt{base06},%opt{base02}"
set-face global StatusLineValue "%opt{base04},%opt{base02}"
set-face global StatusCursor "%opt{base02},%opt{base05}"
set-face global Prompt "%opt{base0A},%opt{base02}"
set-face global MatchingChar "%opt{base0D},%opt{base00}"
set-face global Whitespace "%opt{base01},%opt{base00}+f"
set-face global WrapMarker Whitespace
set-face global BufferPadding "%opt{base04},%opt{base00}"
set-face global Search "%opt{base05},%opt{base01}"

set-face global ts_attribute                    "%opt{base0D}"
set-face global ts_comment                      "%opt{base04}+i"
set-face global ts_conceal                      "%opt{base0E}+i"
set-face global ts_constant                     "%opt{base09}"
set-face global ts_constant_builtin_boolean     "%opt{base0C}"
set-face global ts_constant_character           "%opt{base0A}"
set-face global ts_constant_macro               "%opt{base0E}"
set-face global ts_constructor                  "%opt{base0D}"
set-face global ts_diff_plus                    "%opt{base0B}"
set-face global ts_diff_minus                   "%opt{base08}"
set-face global ts_diff_delta                   "%opt{base0D}"
set-face global ts_diff_delta_moved             "%opt{base0E}"
set-face global ts_error                        "%opt{base08}+b"
set-face global ts_function                     "%opt{base0D}"
set-face global ts_function_builtin             "%opt{base0D}+i"
set-face global ts_function_macro               "%opt{base0E}"
set-face global ts_hint                         "%opt{base0D}+b"
set-face global ts_info                         "%opt{base0B}+b"
set-face global ts_keyword                      "%opt{base0E}"
set-face global ts_keyword_conditional          "%opt{base0E}+i"
set-face global ts_keyword_control_conditional  "%opt{base0E}+i"
set-face global ts_keyword_control_directive    "%opt{base0E}+i"
set-face global ts_keyword_control_import       "%opt{base0E}+i"
set-face global ts_keyword_directive            "%opt{base0E}+i"
set-face global ts_label                        "%opt{base0E}+i"
set-face global ts_markup_bold                  "%opt{base09}+b"
set-face global ts_markup_heading               "%opt{base08}"
set-face global ts_markup_heading_1             "%opt{base08}"
set-face global ts_markup_heading_2             "%opt{base0E}"
set-face global ts_markup_heading_3             "%opt{base0B}"
set-face global ts_markup_heading_4             "%opt{base0A}"
set-face global ts_markup_heading_5             "%opt{base07}"
set-face global ts_markup_heading_6             "%opt{base0C}"
set-face global ts_markup_heading_marker        "%opt{base09}+b"
set-face global ts_markup_italic                "%opt{base07}+i"
set-face global ts_markup_list_checked          "%opt{base0B}"
set-face global ts_markup_list_numbered         "%opt{base0D}+i"
set-face global ts_markup_list_unchecked        "%opt{base0C}"
set-face global ts_markup_list_unnumbered       "%opt{base0E}"
set-face global ts_markup_link_label            "%opt{base0D}"
set-face global ts_markup_link_url              "%opt{base0C}+u"
set-face global ts_markup_link_uri              "%opt{base0C}+u"
set-face global ts_markup_link_text             "%opt{base0D}"
set-face global ts_markup_quote                 "%opt{base04}"
set-face global ts_markup_raw                   "%opt{base0B}"
set-face global ts_markup_strikethrough         "%opt{base04}+s"
set-face global ts_namespace                    "%opt{base0D}+i"
set-face global ts_operator                     "%opt{base0C}"
set-face global ts_property                     "%opt{base0C}"
set-face global ts_punctuation                  "%opt{base04}"
set-face global ts_punctuation_special          "%opt{base0C}"
set-face global ts_special                      "%opt{base0D}"
set-face global ts_spell                        "%opt{base0E}"
set-face global ts_string                       "%opt{base0B}"
set-face global ts_string_regex                 "%opt{base09}"
set-face global ts_string_regexp                "%opt{base09}"
set-face global ts_string_escape                "%opt{base0E}"
set-face global ts_string_special               "%opt{base0D}"
set-face global ts_string_special_path          "%opt{base0B}"
set-face global ts_string_special_symbol        "%opt{base0E}"
set-face global ts_string_symbol                "%opt{base08}"
set-face global ts_tag                          "%opt{base0E}"
set-face global ts_tag_error                    "%opt{base08}"
set-face global ts_text                         "%opt{base05}"
set-face global ts_text_title                   "%opt{base0E}"
set-face global ts_type                         "%opt{base0A}"
set-face global ts_type_enum_variant            "%opt{base03}"
set-face global ts_variable                     "%opt{base05}"
set-face global ts_variable_builtin             "%opt{base08}"
set-face global ts_variable_other_member        "%opt{base0C}"
set-face global ts_variable_parameter           "%opt{base0F}+i"
set-face global ts_warning                      "%opt{base09}+b"
JamyGolden commented 1 month ago

Thanks, I created a PR for it https://github.com/tinted-theming/base16-kakoune/pull/4