From 803c1812016bd41b82c006a5e80c9ccea080640e Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Fri, 11 Oct 2024 22:58:30 +0200 Subject: [PATCH] kak: finish statusbar style #2 --- config/dot-config/kak/kakrc | 15 +- config/dot-config/kak/starship.style1.toml | 215 +++++++++++++++++++++ config/dot-config/kak/starship.style2.toml | 202 +++++++++++++++++++ config/dot-config/kak/starship.toml | 177 ++++++++--------- 4 files changed, 512 insertions(+), 97 deletions(-) create mode 100644 config/dot-config/kak/starship.style1.toml create mode 100644 config/dot-config/kak/starship.style2.toml diff --git a/config/dot-config/kak/kakrc b/config/dot-config/kak/kakrc index 2c1f257f..782c0936 100644 --- a/config/dot-config/kak/kakrc +++ b/config/dot-config/kak/kakrc @@ -149,6 +149,12 @@ source "%val{config}/dabruin-wrapper.kak" # declare-option str dabruin_accent 'rgb:86c1b9' colorscheme dabruin +set-face global StatusLine cyan,default,default +set-face global StatusLineInfo blue,default,default +set-face global StatusLineMode black,yellow,default +set-face global StatusLineValue green,default,default + + # wrapping only word-wise add-highlighter global/ wrap -word -indent @@ -169,12 +175,17 @@ add-highlighter global/ number-lines -hlcursor -min-digits 3 # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── # Shades of green/yellow for insert mode. hook global ModeChange (push|pop):.*:insert %{ - set-face window StatusLine black,rgb:eb6f92 + set-face window StatusLine black,yellow + set-face window StatusLineInfo blue,black + set-face window StatusLineMode black,yellow } # Undo colour changes when we leave insert mode. hook global ModeChange (push|pop):insert:.* %{ - unset-face window StatusLine + # unset-face window StatusLine + set-face window StatusLine yellow,black + set-face window StatusLineInfo blue,default + set-face window StatusLineMode black,yellow } diff --git a/config/dot-config/kak/starship.style1.toml b/config/dot-config/kak/starship.style1.toml new file mode 100644 index 00000000..b390746c --- /dev/null +++ b/config/dot-config/kak/starship.style1.toml @@ -0,0 +1,215 @@ +add_newline = false +format = """\ +[░▒▓](fg:bright-black)${custom.kakbuflist}[▓▒░](fg:bright-black bg:black)\ +[░▒▓](fg:blue bg:black)\ +${custom.kaklsp_progress}\ +${custom.kakcursor}\ +${custom.kakposition}\ +[](fg:blue bg:green)\ +${directory}\ +${custom.kakfile}\ +${custom.kaklsp_err}\ +${custom.kaklsp_warn}\ +${custom.kaklsp_hint}\ +${custom.kaklsp_code_actions}\ +[](fg:green bg:black)\ +${git_branch}\ +${git_commit}\ +${git_state}\ +${git_status}\ +[](fg:black bg:cyan)\ +${custom.kaksession}\ +[](fg:cyan bg:black)\ +${custom.kakfiletype}\ +[](bg:default fg:black)\ +${custom.kakmode}\ +${custom.kakcontext}\ +${custom.kaktime} +""" + + +[time] +format = "[]($style)[  $time ]($style)" +style = "fg:black bg:bright-green" +time_format = "%H:%M" +disabled = true + +[git_branch] +symbol = "" +style = "fg:green bg:black" +format = '[ $symbol $branch ]($style)' + +[git_commit] +format = '[\($hash$tag\)]($style)' +style = 'bg:black fg:green dimmed' +commit_hash_length = 6 +only_detached = false +tag_symbol = ' 笠' +tag_disabled = false +disabled = false + +[git_state] +format = '\( [$state($progress_current/$progress_total)]($style)\)' +style = "bg:black fg:white dimmed" +rebase = 'REBASING' +merge = 'MERGING' +revert = 'REVERTING' +cherry_pick = 'CHERRY-PICKING' +bisect = 'BISECTING' +am = 'AM' +am_or_rebase = 'AM/REBASE' +disabled = false + +[git_status] +format = '[ \[$all_status$ahead_behind\]]($style)[ ]($style)' +style = 'fg:bright-green bold bg:black' +stashed = '\$' +ahead = '⇡${count}' +behind = '⇣${count}' +diverged = '⇕⇡${ahead_count}⇣${behind_count}' +conflicted = '=' +deleted = '✘' +renamed = '»' +modified = '!' +staged = '+' +untracked = '?' +disabled = false + +[directory] +format = '[ $read_only]($style)[$path]($style)' +truncation_length = 8 +truncate_to_repo = true +fish_style_pwd_dir_length = 0 +use_logical_path = true +style = 'bg:green fg:black' +read_only_style = 'bg:green fg:red' +read_only = '[]' +truncation_symbol = '…' +disabled = false + +[directory.substitutions] +"dotfiles/config/dot-config" = "config" +"dotfiles/local/dot-local" = "local" +"~/.config" = " " +"~/.workspace/rust" = "" +"~/.workspace/docker" = " " +"~/.workspace/alpine" = " " +"~/.workspace/arch" = " " +"~/.workspace/kustomize" = "ﴱ " +"~/.workspace/node" = "" +"~/.workspace" = " " +"~/scm" = " " +"~" = " " + +[custom.kakfile] +description = 'The current Kakoune buffername' +format = '[/$output ]($style)' +style = 'bg:green fg:black' +command = 'echo -n ${kak_buffile##*/}' +when = 'true' +shell = ['sh'] +disabled = false + +[custom.kaksession] +description = 'The current Kakoune session' +format = '[  %val{client}:%val{session} ]($style)' +style = 'bg:cyan fg:black' +when = '' +shell = ['true'] +disabled = false + +[custom.kakcursor] +description = 'The current Kakoune cursor position' +format = '[ %val{cursor_line}:%val{cursor_char_column}]($style)' +style = 'fg:black bg:blue' +when = '' +shell = ['true'] +disabled = false + +[custom.kakposition] +description = 'Relative position of the cursor inside the buffer' +format = '[ 󰗉 $output ]($style)' +style = 'bold fg:black bg:blue' +command = 'echo -n $(($kak_cursor_line * 100 / $kak_buf_line_count))%' +when = '[ -n "$kak_cursor_line" ]' +shell = ['sh'] +disabled = false + +[custom.kakmode] +description = 'The current Kakoune mode' +format = ' {{mode_info}}' +when = '' +shell = ['true'] +disabled = false + +[custom.kakcontext] +description = 'The current Kakoune context' +format = '{{context_info}} ' +when = '' +shell = ['true'] +disabled = false + +[custom.kakfiletype] +description = 'The current buffer filetype' +format = '[ %opt{filetype} ]($style)' +style = 'bg:black fg:cyan' +when = '' +shell = ['true'] +disabled = false + +[custom.kaktime] +description = "Alternate time segment using kakoune evaluation" +format = "[]($style)[  %sh{date +%H:%M} ]($style)" +style = "fg:black bg:bright-green" +when = '' +shell = ['true'] +disabled = true + +[custom.kaklsp_err] +description = "Show errors number from kak-lsp if any" +format = "[  %opt{lsp_diagnostic_error_count}]($style)" +style = "red bold" +when = '[ -n "$kak_opt_lsp_diagnostic_error_count" -a "$kak_opt_lsp_diagnostic_error_count" -ne 0 ]' +shell = ['sh'] +disabled = false + +[custom.kaklsp_warn] +description = "Show warnings number from kak-lsp if any" +format = "[  %opt{lsp_diagnostic_warning_count}]($style)" +style = "yellow bold" +when = '[ -n "$kak_opt_lsp_diagnostic_warning_count" -a "$kak_opt_lsp_diagnostic_warning_count" -ne 0 ]' +shell = ['sh'] +disabled = false + +[custom.kaklsp_hint] +description = "Show hints number from kak-lsp if any" +format = "[ ﯦ %opt{lsp_diagnostic_hint_count}]($style)" +style = "yellow bold" +when = '[ -n "$kak_opt_lsp_diagnostic_hint_count" -a "$kak_opt_lsp_diagnostic_hint_count" -ne 0 ]' +shell = ['sh'] +disabled = false + +[custom.kaklsp_code_actions] +description = "Show lsp code actions if any" +format = "[ %opt{lsp_modeline_code_actions} ]($style)" +style = "yellow bold" +when = '[ -n "$kak_opt_lsp_modeline_code_actions" ]' +shell = ['sh'] +disabled = true + +[custom.kaklsp_progress] +description = "Show activity of kak-lsp if any" +format = "[ ]($style)" +style = "bright-white bold" +when = '[ -n "$kak_opt_lsp_modeline_progress" ]' +shell = ['sh'] +disabled = false + +[custom.kakbuflist] +description = "Open buffers" +format = '[ numbufs: $output ]($style)' +style = 'bg:bright-black fg:bright-white' +when = 'true' +shell = ['sh'] +command = 'kks get -s ${kak_session##*/} %val{buflist} | wc -w' +disabled = false diff --git a/config/dot-config/kak/starship.style2.toml b/config/dot-config/kak/starship.style2.toml new file mode 100644 index 00000000..5a2db18f --- /dev/null +++ b/config/dot-config/kak/starship.style2.toml @@ -0,0 +1,202 @@ +add_newline = false +format = """\ +${custom.kakmode}\ +${custom.kakcontext}\ +${custom.kaklsp_progress}\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$directory\ +${custom.kakfile}\ +${custom.kakfiletype}\ +${custom.kaklsp_err}\ +${custom.kaklsp_warn}\ +${custom.kaklsp_hint}\ +${custom.kaklsp_code_actions}\ +$package\ +${custom.kaksession}\ +${custom.kakbuflist}\ +${custom.kakcursor}\ +${custom.kakposition}\ +""" +# use this useless block to prevent spilling colors on insert mode +# [█](fg:black bg:black) +# powerline symbols +# ' '' '' '' '' '' '' + +[fill] +symbol = ' ' + +[git_branch] +symbol = "" +style = "fg:black bg:cyan bold" +format = '[ ](fg:cyan bg:black)[ $symbol $branch ]($style)' + +[git_commit] +format = '[ \($hash$tag\)]($style)' +style = 'bg:cyan fg:bright-black' +commit_hash_length = 6 +only_detached = false +tag_symbol = ' 笠' +tag_disabled = false +disabled = false + +[git_state] +format = '\( [$state($progress_current/$progress_total)]($style)\)' +style = "bg:cyan fg:black" +rebase = 'REBASING' +merge = 'MERGING' +revert = 'REVERTING' +cherry_pick = 'CHERRY-PICKING' +bisect = 'BISECTING' +am = 'AM' +am_or_rebase = 'AM/REBASE' +disabled = true + +[git_status] +format = '[ \[$all_status$ahead_behind\]]($style)[ ]($style)' +style = 'fg:black bold bg:cyan' +stashed = '\$' +ahead = '⇡${count}' +behind = '⇣${count}' +diverged = '⇕⇡${ahead_count}⇣${behind_count}' +conflicted = '=' +deleted = '✘' +renamed = '»' +modified = '!' +staged = '+' +untracked = '?' +disabled = false + +[directory] +format = '[](fg:green bg:blue)[ $read_only]($style)[$path]($style)' +truncation_length = 8 +truncate_to_repo = true +fish_style_pwd_dir_length = 0 +use_logical_path = true +style = 'bg:green fg:black' +read_only_style = 'bg:green fg:red' +read_only = '[]' +truncation_symbol = '…' +disabled = false + +[directory.substitutions] +"dotfiles/config/dot-config" = "config" +"dotfiles/local/dot-local" = "local" +"~/.config" = " " +"~/.workspace/rust" = "" +"~/.workspace/docker" = " " +"~/.workspace/alpine" = " " +"~/.workspace/arch" = " " +"~/.workspace/kustomize" = "ﴱ " +"~/.workspace/node" = "" +"~/.workspace" = " " +"~/scm" = " " +"~" = " " + +[custom.kakfile] +description = 'The current Kakoune buffername' +format = '[/$output ]($style)' +style = 'bg:green fg:black' +command = 'echo -n ${kak_buffile##*/}' +when = 'true' +shell = ['sh'] +disabled = false + +[custom.kakfiletype] +description = 'The current buffer filetype' +format = '[](fg:black bg:green)[ %opt{filetype} ]($style)' +style = 'bg:black fg:yellow' +when = '' +shell = ['true'] +disabled = false + +[custom.kaklsp_err] +description = "Show errors number from kak-lsp if any" +format = "[ %opt{lsp_diagnostic_error_count}]($style)" +style = "fg:red bold bg:black" +when = '[ -n "$kak_opt_lsp_diagnostic_error_count" -a "$kak_opt_lsp_diagnostic_error_count" -ne 0 ]' +shell = ['sh'] +disabled = true + +[custom.kaklsp_warn] +description = "Show warnings number from kak-lsp if any" +format = "[  %opt{lsp_diagnostic_warning_count}]($style)" +style = "fg:yellow bold bg:black" +when = '[ -n "$kak_opt_lsp_diagnostic_warning_count" -a "$kak_opt_lsp_diagnostic_warning_count" -ne 0 ]' +shell = ['sh'] +disabled = true + +[custom.kaklsp_hint] +description = "Show hints number from kak-lsp if any" +format = "[ ﯦ %opt{lsp_diagnostic_hint_count}]($style)" +style = "fg:white bold bg:black" +when = '[ -n "$kak_opt_lsp_diagnostic_hint_count" -a "$kak_opt_lsp_diagnostic_hint_count" -ne 0 ]' +shell = ['sh'] +disabled = true + +[custom.kaklsp_code_actions] +description = "Show lsp code actions if any" +format = "[ %opt{lsp_modeline_code_actions} ]($style)" +style = "fg:yellow bold bg:black" +when = '[ -n "$kak_opt_lsp_modeline_code_actions" ]' +shell = ['sh'] +disabled = true + +[custom.kaklsp_progress] +description = "Show activity of kak-lsp if any" +format = " [ ]($style)" +style = "fg:bright-white bold bg:black" +when = '[ -n "$kak_opt_lsp_modeline_progress" ]' +shell = ['sh'] +disabled = false + +[custom.kakbuflist] +description = "Open buffers" +format = '[](fg:white bg:bright-black)[ numbufs: $output ]($style)' +style = 'bg:white fg:black' +when = 'true' +shell = ['sh'] +command = 'kks get -s ${kak_session##*/} %val{buflist} | grep -vE "(\*debug\*|\*scratch\*)" | wc -w' +disabled = false + +[custom.kaksession] +description = 'The current Kakoune session' +format = '[](fg:bright-black bg:black)[  %val{client}:%val{session} ]($style)' +style = 'bg:bright-black fg:black' +when = '' +shell = ['true'] +disabled = false + +[custom.kakcursor] +description = 'The current Kakoune cursor position' +format = '[](fg:bright-white bg:white)[%val{cursor_line}:%val{cursor_char_column}]($style)' +style = 'fg:black bg:bright-white' +when = '' +shell = ['true'] +disabled = false + +[custom.kakposition] +description = 'Relative position of the cursor inside the buffer' +format = '[  $output]($style)[ ]($style)' +style = 'fg:black bg:bright-white' +command = 'echo -n $(($kak_cursor_line * 100 / $kak_buf_line_count))%' +when = '[ -n "$kak_cursor_line" ]' +shell = ['sh'] +disabled = false + +[custom.kakcontext] +description = 'The current Kakoune context' +format = '{{context_info}}' +when = '' +shell = ['true'] +disabled = false + +[custom.kakmode] +description = 'The current Kakoune mode' +format = '{{mode_info}}' +when = '' +shell = ['true'] +disabled = false + diff --git a/config/dot-config/kak/starship.toml b/config/dot-config/kak/starship.toml index 839b0455..5a2db18f 100644 --- a/config/dot-config/kak/starship.toml +++ b/config/dot-config/kak/starship.toml @@ -1,47 +1,41 @@ add_newline = false format = """\ -[░▒▓](fg:bright-black)${custom.kakbuflist}[▓▒░](fg:bright-black bg:black)\ -[░▒▓](fg:blue bg:black)\ +${custom.kakmode}\ +${custom.kakcontext}\ ${custom.kaklsp_progress}\ -${custom.kakcursor}\ -${custom.kakposition}\ -[](fg:blue bg:green)\ -${directory}\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$directory\ ${custom.kakfile}\ +${custom.kakfiletype}\ ${custom.kaklsp_err}\ ${custom.kaklsp_warn}\ ${custom.kaklsp_hint}\ ${custom.kaklsp_code_actions}\ -[](fg:green bg:black)\ -${git_branch}\ -${git_commit}\ -${git_state}\ -${git_status}\ -[](fg:black bg:cyan)\ +$package\ ${custom.kaksession}\ -[](fg:cyan bg:black)\ -${custom.kakfiletype}\ -[](bg:default fg:black)\ -${custom.kakmode}\ -${custom.kakcontext}\ -${custom.kaktime} +${custom.kakbuflist}\ +${custom.kakcursor}\ +${custom.kakposition}\ """ +# use this useless block to prevent spilling colors on insert mode +# [█](fg:black bg:black) +# powerline symbols +# ' '' '' '' '' '' '' - -[time] -format = "[]($style)[  $time ]($style)" -style = "fg:black bg:bright-green" -time_format = "%H:%M" -disabled = true +[fill] +symbol = ' ' [git_branch] -symbol = "" -style = "fg:green bg:black" -format = '[ $symbol $branch ]($style)' +symbol = "" +style = "fg:black bg:cyan bold" +format = '[ ](fg:cyan bg:black)[ $symbol $branch ]($style)' [git_commit] -format = '[\($hash$tag\)]($style)' -style = 'bg:black fg:green dimmed' +format = '[ \($hash$tag\)]($style)' +style = 'bg:cyan fg:bright-black' commit_hash_length = 6 only_detached = false tag_symbol = ' 笠' @@ -50,7 +44,7 @@ disabled = false [git_state] format = '\( [$state($progress_current/$progress_total)]($style)\)' -style = "bg:black fg:white dimmed" +style = "bg:cyan fg:black" rebase = 'REBASING' merge = 'MERGING' revert = 'REVERTING' @@ -58,11 +52,11 @@ cherry_pick = 'CHERRY-PICKING' bisect = 'BISECTING' am = 'AM' am_or_rebase = 'AM/REBASE' -disabled = false +disabled = true [git_status] format = '[ \[$all_status$ahead_behind\]]($style)[ ]($style)' -style = 'fg:bright-green bold' +style = 'fg:black bold bg:cyan' stashed = '\$' ahead = '⇡${count}' behind = '⇣${count}' @@ -76,7 +70,7 @@ untracked = '?' disabled = false [directory] -format = '[ $read_only]($style)[$path]($style)' +format = '[](fg:green bg:blue)[ $read_only]($style)[$path]($style)' truncation_length = 8 truncate_to_repo = true fish_style_pwd_dir_length = 0 @@ -110,106 +104,99 @@ when = 'true' shell = ['sh'] disabled = false -[custom.kaksession] -description = 'The current Kakoune session' -format = '[  %val{client}:%val{session} ]($style)' -style = 'bg:cyan fg:black' -when = '' -shell = ['true'] -disabled = false - -[custom.kakcursor] -description = 'The current Kakoune cursor position' -format = '[ %val{cursor_line}:%val{cursor_char_column}]($style)' -style = 'fg:black bg:blue' -when = '' -shell = ['true'] -disabled = false - -[custom.kakposition] -description = 'Relative position of the cursor inside the buffer' -format = '[ 󰗉 $output ]($style)' -style = 'bold fg:black bg:blue' -command = 'echo -n $(($kak_cursor_line * 100 / $kak_buf_line_count))%' -when = '[ -n "$kak_cursor_line" ]' -shell = ['sh'] -disabled = false - -[custom.kakmode] -description = 'The current Kakoune mode' -format = ' {{mode_info}}' -when = '' -shell = ['true'] -disabled = false - -[custom.kakcontext] -description = 'The current Kakoune context' -format = '{{context_info}} ' -when = '' -shell = ['true'] -disabled = false - [custom.kakfiletype] description = 'The current buffer filetype' -format = '[ %opt{filetype} ]($style)' -style = 'bg:black fg:cyan' +format = '[](fg:black bg:green)[ %opt{filetype} ]($style)' +style = 'bg:black fg:yellow' when = '' shell = ['true'] disabled = false -[custom.kaktime] -description = "Alternate time segment using kakoune evaluation" -format = "[]($style)[  %sh{date +%H:%M} ]($style)" -style = "fg:black bg:bright-green" -when = '' -shell = ['true'] -disabled = true - [custom.kaklsp_err] description = "Show errors number from kak-lsp if any" -format = "[  %opt{lsp_diagnostic_error_count}]($style)" -style = "red bold" +format = "[ %opt{lsp_diagnostic_error_count}]($style)" +style = "fg:red bold bg:black" when = '[ -n "$kak_opt_lsp_diagnostic_error_count" -a "$kak_opt_lsp_diagnostic_error_count" -ne 0 ]' shell = ['sh'] -disabled = false +disabled = true [custom.kaklsp_warn] description = "Show warnings number from kak-lsp if any" format = "[  %opt{lsp_diagnostic_warning_count}]($style)" -style = "yellow bold" +style = "fg:yellow bold bg:black" when = '[ -n "$kak_opt_lsp_diagnostic_warning_count" -a "$kak_opt_lsp_diagnostic_warning_count" -ne 0 ]' shell = ['sh'] -disabled = false +disabled = true [custom.kaklsp_hint] description = "Show hints number from kak-lsp if any" format = "[ ﯦ %opt{lsp_diagnostic_hint_count}]($style)" -style = "yellow bold" +style = "fg:white bold bg:black" when = '[ -n "$kak_opt_lsp_diagnostic_hint_count" -a "$kak_opt_lsp_diagnostic_hint_count" -ne 0 ]' shell = ['sh'] -disabled = false +disabled = true [custom.kaklsp_code_actions] description = "Show lsp code actions if any" format = "[ %opt{lsp_modeline_code_actions} ]($style)" -style = "yellow bold" +style = "fg:yellow bold bg:black" when = '[ -n "$kak_opt_lsp_modeline_code_actions" ]' shell = ['sh'] disabled = true [custom.kaklsp_progress] description = "Show activity of kak-lsp if any" -format = "[ ]($style)" -style = "bright-white bold" +format = " [ ]($style)" +style = "fg:bright-white bold bg:black" when = '[ -n "$kak_opt_lsp_modeline_progress" ]' shell = ['sh'] disabled = false [custom.kakbuflist] description = "Open buffers" -format = '[ numbufs: $output ]($style)' -style = 'bg:bright-black fg:bright-white' +format = '[](fg:white bg:bright-black)[ numbufs: $output ]($style)' +style = 'bg:white fg:black' when = 'true' shell = ['sh'] -command = 'kks get -s ${kak_session##*/} %val{buflist} | wc -w' +command = 'kks get -s ${kak_session##*/} %val{buflist} | grep -vE "(\*debug\*|\*scratch\*)" | wc -w' disabled = false + +[custom.kaksession] +description = 'The current Kakoune session' +format = '[](fg:bright-black bg:black)[  %val{client}:%val{session} ]($style)' +style = 'bg:bright-black fg:black' +when = '' +shell = ['true'] +disabled = false + +[custom.kakcursor] +description = 'The current Kakoune cursor position' +format = '[](fg:bright-white bg:white)[%val{cursor_line}:%val{cursor_char_column}]($style)' +style = 'fg:black bg:bright-white' +when = '' +shell = ['true'] +disabled = false + +[custom.kakposition] +description = 'Relative position of the cursor inside the buffer' +format = '[  $output]($style)[ ]($style)' +style = 'fg:black bg:bright-white' +command = 'echo -n $(($kak_cursor_line * 100 / $kak_buf_line_count))%' +when = '[ -n "$kak_cursor_line" ]' +shell = ['sh'] +disabled = false + +[custom.kakcontext] +description = 'The current Kakoune context' +format = '{{context_info}}' +when = '' +shell = ['true'] +disabled = false + +[custom.kakmode] +description = 'The current Kakoune mode' +format = '{{mode_info}}' +when = '' +shell = ['true'] +disabled = false + -- 2.51.2