# Ashen for Kakoune # Supports kak-tree-sitter and kak-lsp # Author: Daniel Fichtinger # License: MIT # Upstream: https://sr.ht/~ficd/ashen # palette declare-option str cursorline "rgb:191919" declare-option str text "rgb:b4b4b4" declare-option str red_flame "rgb:C53030" declare-option str red_glowing "rgb:DF6464" declare-option str red_ember "rgb:B14242" declare-option str orange_glow "rgb:D87C4A" declare-option str orange_blaze "rgb:C4693D" declare-option str orange_muted "rgb:6D3B22" declare-option str orange_smolder "rgb:E49A44" declare-option str orange_golden "rgb:E5A72A" declare-option str golden_muted "rgb:6D4D0D" declare-option str brown "rgb:89492a" declare-option str brown_dark "rgb:322119" declare-option str brown_darker "rgb:22150F" declare-option str blue "rgb:4A8B8B" declare-option str background "rgb:121212" declare-option str g_1 "rgb:e5e5e5" declare-option str g_2 "rgb:d5d5d5" declare-option str g_3 "rgb:b4b4b4" declare-option str g_4 "rgb:a7a7a7" declare-option str g_5 "rgb:949494" declare-option str g_6 "rgb:737373" declare-option str g_7 "rgb:535353" declare-option str g_8 "rgb:323232" declare-option str g_9 "rgb:212121" declare-option str g_10 "rgb:1d1d1d" declare-option str g_11 "rgb:191919" declare-option str g_12 "rgb:151515" # Built-in Code Highlighting set-face global value "%opt{blue}" set-face global type "%opt{blue}" set-face global variable "%opt{g_3}" set-face global module "%opt{orange_glow}+b" set-face global function "%opt{g_3}+b" set-face global string "%opt{red_glowing}" set-face global keyword "%opt{red_ember}" set-face global operator "%opt{orange_glow}" set-face global attribute "%opt{g_4}" set-face global comment "%opt{g_6}+i" set-face global documentation comment set-face global meta "%opt{red_ember}" set-face global builtin function # Markdown Highlighting set-face global title "%opt{red_glowing}+b" set-face global header "%opt{red_glowing}" set-face global mono "%opt{g_2},%opt{g_10}" set-face global block "%opt{g_2},%opt{g_10}" set-face global link "%opt{red_glowing}+ui" set-face global bullet "%opt{orange_glow}" set-face global list "%opt{orange_glow}" # SPECIAL CURSOR BLOCK # We implement a Helix-like cursor changing color. # Off by default; ashen_dynamic_cursor option must be set to true. try %{ declare-option bool ashen_dynamic_cursor false declare-option bool ashen_eol_cursor false } # Helix-like insert/normal mode cursor set-face global PrimaryCursorNormal "%opt{background},%opt{orange_blaze}+b" set-face global SecondaryCursorNormal "%opt{background},%opt{orange_muted}" set-face global PrimaryCursorInsert "%opt{background},%opt{g_3}+b" set-face global SecondaryCursorInsert "%opt{background},%opt{g_7}" set-face global PrimaryCursorNormalEol "%opt{background},%opt{orange_smolder}+b" set-face global SecondaryCursorNormalEol "%opt{background},%opt{golden_muted}" set-face global PrimaryCursorInsertEol "%opt{background},%opt{g_1}+b" set-face global SecondaryCursorInsertEol "%opt{background},%opt{g_5}" set-face global PrimaryCursor PrimaryCursorNormal set-face global SecondaryCursor SecondaryCursorNormal try %{ hook global WinCreate .* %{ evaluate-commands %sh{ if [ "$kak_opt_ashen_eol_cursor" = "true" ]; then echo "set-face window PrimaryCursorEol PrimaryCursorNormalEol" echo "set-face window SecondaryCursorEol SecondaryCursorNormalEol" else echo "set-face window PrimaryCursorEol PrimaryCursorNormal" echo "set-face window SecondaryCursorEol SecondaryCursorNormal" fi } } define-command -hidden ashen-set-cursor-mode -params 1 %{ evaluate-commands %sh{ MODE="$1" if [ "$kak_opt_ashen_dynamic_cursor" = "true" ]; then echo "set-face window PrimaryCursor PrimaryCursor$MODE" echo "set-face window SecondaryCursor SecondaryCursor$MODE" if [ "$kak_opt_ashen_eol_cursor" = "true" ]; then echo "set-face window PrimaryCursorEol PrimaryCursor${MODE}Eol" echo "set-face window SecondaryCursorEol SecondaryCursor${MODE}Eol" else echo "set-face window PrimaryCursorEol PrimaryCursor$MODE" echo "set-face window SecondaryCursorEol SecondaryCursor$MODE" fi fi } } hook global ModeChange (push|pop):.*insert %{ ashen-set-cursor-mode "Insert" } hook global ModeChange (push|pop):insert:.* %{ ashen-set-cursor-mode "Normal" } } # Built-in UI set-face global Default "%opt{text},%opt{background}" set-face global PrimarySelection ",%opt{brown_dark}+g" set-face global SecondarySelection ",%opt{brown_darker}+g" set-face global PrimaryCursorEol PrimaryCursor set-face global SecondaryCursorEol SecondaryCursor set-face global LineNumbers "%opt{g_8}" set-face global LineNumberCursor "%opt{g_5},%opt{brown_dark}" set-face global LineNumbersWrapped LineNumbers set-face global MenuForeground "%opt{background},%opt{orange_blaze}+b" set-face global MenuBackground "%opt{g_3},%opt{g_9}" set-face global MenuInfo "%opt{text},%opt{g_9}" set-face global Information MenuInfo set-face global InlineInformation "%opt{g_6}+i" set-face global Error "%opt{red_flame},%opt{background}" set-face global DiagnosticError ",,%opt{red_flame}+c" set-face global DiagnosticWarning ",,%opt{orange_golden}+c" set-face global StatusLine "%opt{g_3},%opt{g_9}" set-face global StatusLineMode "%opt{orange_glow}+b" set-face global StatusLineInfo "%opt{red_ember}" set-face global StatusLineValue "%opt{blue}" set-face global StatusCursor "%opt{background},%opt{g_3}+b" set-face global Prompt "%opt{orange_glow}" set-face global MatchingChar "%opt{orange_smolder}+uf" set-face global BufferPadding LineNumbers set-face global Whitespace "%opt{g_7}+f" # Tree-sitter () # kak-tree-sitter defaults set-face global ts_attribute "%opt{g_4}" set-face global ts_comment "%opt{g_6}+i" set-face global ts_comment_unused "%opt{g_6}+is" set-face global ts_conceal "%opt{red_ember}+i" set-face global ts_constant "%opt{orange_blaze}" set-face global ts_constant_builtin_boolean "%opt{blue}" set-face global ts_constant_character "%opt{red_glowing}+b" set-face global ts_constant_macro "%opt{blue}" set-face global ts_constructor "%opt{g_1}" set-face global ts_diff_plus "%opt{g_6}" set-face global ts_diff_minus "%opt{red_ember}" set-face global ts_diff_delta "%opt{brown}" set-face global ts_diff_delta_moved ts_diff_delta set-face global ts_error "%opt{red_flame}" set-face global ts_function "%opt{g_3}+b" set-face global ts_function_builtin "%opt{g_3}+bi" set-face global ts_function_macro "%opt{red_ember}" set-face global ts_hint "%opt{g_4}" set-face global ts_info "%opt{g_2}" set-face global ts_keyword "%opt{red_ember}" set-face global ts_keyword_conditional "%opt{red_ember}" set-face global ts_keyword_control_conditional "%opt{red_ember}" set-face global ts_keyword_control_directive "%opt{red_ember}+i" set-face global ts_keyword_control_import "%opt{red_ember}" set-face global ts_keyword_directive "%opt{red_ember}+i" set-face global ts_keyword_storage "%opt{red_ember}" set-face global ts_keyword_storage_modifier "%opt{red_ember}+i" set-face global ts_keyword_storage_modifier_mut "%opt{red_ember}+i" set-face global ts_keyword_storage_modifier_ref "%opt{red_ember}+i" set-face global ts_label "%opt{red_ember}" set-face global ts_markup_bold "+b" set-face global ts_markup_heading "%opt{red_glowing}+b" set-face global ts_markup_italic "+i" set-face global ts_markup_list_checked "%opt{orange_glow}" set-face global ts_markup_list_numbered "%opt{orange_glow}" set-face global ts_markup_list_unchecked "%opt{orange_glow}" set-face global ts_markup_list_unnumbered "%opt{orange_glow}" set-face global ts_markup_link_label "%opt{red_ember}" set-face global ts_markup_link_url "%opt{red_glowing}+iu" set-face global ts_markup_link_uri "%opt{red_glowing}+iu" set-face global ts_markup_link_text "%opt{red_glowing}" set-face global ts_markup_quote "+i" set-face global ts_markup_raw_block "%opt{g_2}" set-face global ts_markup_raw_inline "%opt{g_2},%opt{g_10}" set-face global ts_markup_strikethrough "+s" set-face global ts_namespace "%opt{orange_glow}+b" set-face global ts_operator "%opt{orange_blaze}" set-face global ts_property "%opt{g_2}" set-face global ts_punctuation "%opt{g_2}" set-face global ts_punctuation_special "%opt{orange_golden}" set-face global ts_special "%opt{orange_smolder}" set-face global ts_spell ",,%opt{g_5}+c" set-face global ts_string "%opt{red_glowing}" set-face global ts_string_regex "%opt{orange_glow}" set-face global ts_string_regexp "%opt{orange_glow}" set-face global ts_string_escape "%opt{g_2}" set-face global ts_string_special "%opt{g_2}" set-face global ts_string_special_path "%opt{red_glowing}+b" set-face global ts_string_special_symbol "%opt{orange_smolder}" set-face global ts_string_symbol "%opt{orange_glow}" set-face global ts_tag "%opt{orange_glow}+i" set-face global ts_tag_error "%opt{red_flame}+i" set-face global ts_text "%opt{text}" set-face global ts_text_title "%opt{red_glowing}+b" set-face global ts_type "%opt{blue}" set-face global ts_type_enum_variant "%opt{orange_blaze}" set-face global ts_type_enum_variant_builtin "%opt{orange_blaze}" set-face global ts_variable "%opt{g_3}" set-face global ts_variable_builtin "%opt{blue}" set-face global ts_variable_other_member "%opt{g_2}" set-face global ts_variable_parameter "%opt{g_2}+i" set-face global ts_warning "%opt{orange_golden}" # Helix capture groups set-face global ts_punctuation_delimiter "%opt{orange_smolder}" set-face global ts_punctuation_bracket "%opt{g_6}" set-face global ts_type_builtin "%opt{blue}" set-face global ts_type_parameter "%opt{orange_glow}" set-face global ts_constant_builtin "%opt{blue}" set-face global ts_constant_character_escape "%opt{g_2}" set-face global ts_constant_numeric "%opt{blue}" set-face global ts_string_special_url "%opt{red_glowing}+b" set-face global ts_comment_block_documentation "%opt{g_5}+i" set-face global ts_keyword_operator "%opt{orange_blaze}" set-face global ts_markup_list "%opt{orange_glow}" # kak-lsp set-face global InlayHint "%opt{g_5},%opt{g_12}+i" set-face global parameter "@ts_variable_paramter" set-face global enum "@ts_type_enum_variant" set-face global InlayDiagnosticError Error set-face global InlayDiagnosticWarning "%opt{orange_golden}" set-face global InlayDiagnosticInfo "%opt{g_2}" set-face global InlayDiagnosticHint "%opt{g_4}" set-face global LineFlagError "%opt{red_flame}" set-face global LineFlagWarning "%opt{orange_golden}" set-face global LineFlagInfo "%opt{g_2}" set-face global LineFlagHint "%opt{g_4}" set-face global DiagnosticError ",,%opt{red_flame}+c" set-face global DiagnosticWarning ",,%opt{orange_golden}+c" set-face global DiagnosticInfo ",,%opt{g_2}+c" set-face global DiagnosticHint ",,%opt{g_4}+c" # Infobox faces set-face global InfoDefault Information set-face global InfoBlock block set-face global InfoBlockQuote block set-face global InfoBullet bullet set-face global InfoHeader header set-face global InfoLink link set-face global InfoLinkMono header set-face global InfoMono mono set-face global InfoRule comment set-face global InfoDiagnosticError InlayDiagnosticError set-face global InfoDiagnosticHint InlayDiagnosticHint set-face global InfoDiagnosticInformation InlayDiagnosticInfo set-face global InfoDiagnosticWarning InlayDiagnosticWarning