From 76f61dc5fe8b057c53e890e6c924344bc3339b35 Mon Sep 17 00:00:00 2001 From: Andrejus Date: Tue, 24 Feb 2026 18:57:23 +0000 Subject: [PATCH] tmux, vim, terminal theming --- home/.config/bat/config | 2 + home/.config/bat/themes/dots.tmTheme | 269 +++++++++++++++++++++++++++ home/.profile | 1 + home/.tmux.conf | 29 ++- home/.tmux/battery.sh | 17 +- home/.tmux/tab-name.sh | 19 ++ home/.vimrc | 59 +++++- home/.zsh/prompt.zsh | 67 +++++-- home/.zsh/widgets.zsh | 4 +- home/.zshrc | 40 +++- 10 files changed, 470 insertions(+), 37 deletions(-) create mode 100644 home/.config/bat/config create mode 100644 home/.config/bat/themes/dots.tmTheme create mode 100755 home/.tmux/tab-name.sh diff --git a/home/.config/bat/config b/home/.config/bat/config new file mode 100644 index 0000000..2d6fe92 --- /dev/null +++ b/home/.config/bat/config @@ -0,0 +1,2 @@ +--map-syntax="*.arch:Dockerfile" +--map-syntax="*.debian:Dockerfile" diff --git a/home/.config/bat/themes/dots.tmTheme b/home/.config/bat/themes/dots.tmTheme new file mode 100644 index 0000000..058192d --- /dev/null +++ b/home/.config/bat/themes/dots.tmTheme @@ -0,0 +1,269 @@ + + + + + name + dots + settings + + + settings + + foreground + #CCE0D0 + background + #00000000 + caret + #CCE0D0 + selection + #1A3050 + lineHighlight + #0A2A1A + gutterForeground + #808080 + + + + name + Comment + scope + comment + settings + + foreground + #808080 + fontStyle + italic + + + + name + String + scope + string + settings + + foreground + #2CB494 + + + + name + Number + scope + constant.numeric + settings + + foreground + #F88C14 + + + + name + Constant + scope + constant, constant.language, constant.character + settings + + foreground + #F88C14 + + + + name + Keyword + scope + keyword, keyword.control, keyword.operator.logical, keyword.operator.assignment, keyword.other, support.function + settings + + foreground + #4068D4 + + + + name + Storage + scope + storage, storage.type, storage.modifier + settings + + foreground + #4068D4 + + + + name + Function + scope + entity.name.function, entity.name.tag, support.function.builtin + settings + + foreground + #7290B8 + fontStyle + bold + + + + name + Type + scope + entity.name.type, entity.name.class, support.type, support.class + settings + + foreground + #2CB494 + + + + name + Variable + scope + variable, variable.parameter + settings + + foreground + #CCE0D0 + + + + name + Operator + scope + keyword.operator + settings + + foreground + #CCE0D0 + + + + name + Special + scope + constant.character.escape, string.regexp + settings + + foreground + #88409C + + + + name + Preprocessor + scope + meta.preprocessor, keyword.control.import, keyword.control.directive + settings + + foreground + #F88C14 + + + + name + Tag Attribute + scope + entity.other.attribute-name + settings + + foreground + #7290B8 + + + + name + Invalid + scope + invalid + settings + + foreground + #F40404 + fontStyle + bold underline + + + + name + Markup Heading + scope + markup.heading, entity.name.section + settings + + foreground + #7290B8 + fontStyle + bold + + + + name + Markup Bold + scope + markup.bold + settings + + fontStyle + bold + + + + name + Markup Italic + scope + markup.italic + settings + + fontStyle + italic + + + + name + Markup Code + scope + markup.raw, markup.inline.raw + settings + + foreground + #F88C14 + + + + name + Markup Link + scope + markup.underline.link, meta.link + settings + + foreground + #4068D4 + fontStyle + underline + + + + name + Markup List + scope + markup.list punctuation.definition.list_item + settings + + foreground + #F88C14 + + + + name + Punctuation + scope + punctuation.definition.heading, punctuation.definition.bold, punctuation.definition.italic + settings + + foreground + #808080 + + + + + diff --git a/home/.profile b/home/.profile index debe143..a7333aa 100644 --- a/home/.profile +++ b/home/.profile @@ -10,6 +10,7 @@ fi export EDITOR=vim export VISUAL=vim export PAGER=less +export BAT_THEME=dots # Homebrew export HOMEBREW_NO_ANALYTICS=1 diff --git a/home/.tmux.conf b/home/.tmux.conf index ef9dad3..b4203f8 100644 --- a/home/.tmux.conf +++ b/home/.tmux.conf @@ -6,6 +6,8 @@ bind C-a send-prefix # True color set -g default-terminal "tmux-256color" set -ag terminal-overrides ",xterm-256color:RGB" +set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' +set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # Shell set -g default-shell "$SHELL" @@ -58,20 +60,29 @@ bind r source-file ~/.tmux.conf \; display "Config reloaded" # Status bar set -g status-position bottom -set -g status-interval 5 +set -g status-interval 1 set -g status-style "fg=#728cb8,bg=default" -set -g status-left "" -set -g status-right "#[fg=#808080]%a %d %b #[fg=#2cb494,bold]%H:%M #(~/.tmux/battery.sh)" -set -g window-status-format " #I:#W " -set -g window-status-current-format "#[fg=#2cb494,bold] #I:#W " -set -g window-status-bell-style "fg=#f88c14,bold" -set -g pane-border-style "fg=#728cb8" +set -g status-left "#{?client_prefix,#[fg=#2cb494]● ,#[fg=#3c3c3c]● }" +set -g status-right "#(~/.tmux/battery.sh) #[fg=#808080,bg=default]%a %d %b #[fg=#2cb494,bg=#1a1a1a] %H:%M #[default] " +set -g status-right-length 60 +set -g window-status-format " #I #W " +set -g window-status-current-format " #[fg=#085040]#I#[fg=#0a0a0a] #W " +set -g window-status-separator " " +set -g window-status-style "fg=#808080,bg=#1a1a1a" +set -g window-status-current-style "fg=#0a0a0a,bg=#2cb494,bold" +set -g window-status-bell-style "fg=#1a1a1a,bg=#f88c14,bold" +set -g monitor-bell on +set -g visual-bell off +set -g pane-border-style "fg=#3c3c3c" set -g pane-active-border-style "fg=#2cb494" set -g message-style "fg=#2cb494,bg=default" set -g message-command-style "fg=#f88c14,bg=default" -set -g mode-style "fg=default,bg=#728cb8,bold" +set -g mode-style "fg=#1a1a1a,bg=#f88c14,bold" +set -g display-panes-colour "#808080" +set -g display-panes-active-colour "#2cb494" # Clock set -g clock-mode-colour "#2cb494" set -g automatic-rename on -set -g automatic-rename-format '#{?#{==:#{pane_current_command},zsh},zsh:#{b:pane_current_path},#{pane_current_command}}' +set -g allow-rename off +set -g automatic-rename-format '#(~/.tmux/tab-name.sh "#{pane_current_command}" "#{b:pane_current_path}")' diff --git a/home/.tmux/battery.sh b/home/.tmux/battery.sh index 03ee7ff..e90ce50 100755 --- a/home/.tmux/battery.sh +++ b/home/.tmux/battery.sh @@ -1,28 +1,33 @@ #!/usr/bin/env bash # Battery indicator for tmux status bar. -# Shows percentage only when on battery; amber when <=20%. +# 󰚥 AC when full/plugged, 󰂄 charging with %, amber 󰂃 when <=20%. pct="" charging="" +full="" if command -v pmset &>/dev/null; then # macOS info=$(pmset -g batt) pct=$(echo "$info" | grep -o '[0-9]\+%' | head -1 | tr -d '%') echo "$info" | grep -q 'AC Power' && charging=1 + echo "$info" | grep -q 'charged\|finishing charge' && full=1 elif [[ -f /sys/class/power_supply/BAT0/capacity ]]; then # Linux pct=$(cat /sys/class/power_supply/BAT0/capacity) status=$(cat /sys/class/power_supply/BAT0/status) - [[ "$status" == "Charging" || "$status" == "Full" ]] && charging=1 + [[ "$status" == "Charging" ]] && charging=1 + [[ "$status" == "Full" || "$status" == "Not charging" ]] && full=1 fi [[ -z "$pct" ]] && exit 0 -if [[ -n "$charging" ]]; then - echo "#[fg=#808080]AC#[default]" +if [[ -n "$full" ]]; then + echo "#[fg=#808080]󰚥 AC#[default]" +elif [[ -n "$charging" ]]; then + echo "#[fg=#808080]󰂄 ${pct}%#[default]" elif (( pct <= 20 )); then - echo "#[fg=#f88c14,bold]${pct}%#[default]" + echo "#[fg=#f88c14,bold]󰂃 ${pct}%#[default]" else - echo "#[fg=#808080]${pct}%#[default]" + echo "#[fg=#808080]󰁹 ${pct}%#[default]" fi diff --git a/home/.tmux/tab-name.sh b/home/.tmux/tab-name.sh new file mode 100755 index 0000000..d048b61 --- /dev/null +++ b/home/.tmux/tab-name.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Tab name for tmux automatic-rename. +# Usage: tab-name.sh +# Shows dirname for shells, command for everything else. Truncates at 15 with …. + +cmd="$1" +dir="$2" +max=15 + +case "$cmd" in + zsh|bash|fish|sh) name="$dir" ;; + *) name="$cmd" ;; +esac + +if (( ${#name} > max )); then + echo "${name:0:$max}…" +else + echo "$name" +fi diff --git a/home/.vimrc b/home/.vimrc index 5fdf636..8be5ce2 100644 --- a/home/.vimrc +++ b/home/.vimrc @@ -58,6 +58,9 @@ set background=dark if has('termguicolors') && ($COLORTERM ==# 'truecolor' || $COLORTERM ==# '24bit') let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" + let &t_AU = "\[58:2::%lu:%lu:%lum" + let &t_Cs = "\[4:3m" + let &t_Ce = "\[4:0m" set termguicolors endif @@ -104,9 +107,9 @@ highlight diffIndexLine guifg=#88409C highlight diffLine guifg=#00E4FC highlight diffSubname guifg=#F88C14 -highlight SpellBad guifg=#F40404 gui=undercurl guisp=#F40404 -highlight SpellCap guifg=#FCFC38 gui=undercurl guisp=#FCFC38 -highlight SpellRare guifg=#88409C gui=undercurl guisp=#88409C +highlight SpellBad guifg=NONE guibg=#2A1A0A gui=NONE cterm=NONE ctermfg=NONE ctermbg=NONE +highlight SpellCap guifg=NONE guibg=#2A1A0A gui=NONE cterm=NONE ctermfg=NONE ctermbg=NONE +highlight SpellRare guifg=NONE guibg=#2A1A0A gui=NONE cterm=NONE ctermfg=NONE ctermbg=NONE highlight Visual guibg=#1A3050 @@ -174,16 +177,66 @@ highlight htmlTagName guifg=#4068D4 highlight htmlLink guifg=#CCE0D0 gui=underline highlight htmlTag guifg=#808080 highlight htmlEndTag guifg=#808080 +highlight markdownH1 guifg=#7290B8 gui=bold +highlight markdownH2 guifg=#7290B8 gui=bold +highlight markdownH3 guifg=#7290B8 gui=bold +highlight markdownH4 guifg=#7290B8 gui=bold +highlight markdownH5 guifg=#7290B8 gui=bold +highlight markdownH6 guifg=#7290B8 gui=bold highlight markdownH1Delimiter guifg=#808080 highlight markdownH2Delimiter guifg=#808080 highlight markdownH3Delimiter guifg=#808080 highlight markdownH4Delimiter guifg=#808080 highlight markdownH5Delimiter guifg=#808080 highlight markdownH6Delimiter guifg=#808080 +highlight markdownCode guifg=#F88C14 +highlight markdownCodeBlock guifg=#F88C14 +highlight markdownCodeDelimiter guifg=#808080 +highlight markdownUrl guifg=#4068D4 gui=underline +highlight markdownLinkText guifg=#2CB494 +highlight markdownListMarker guifg=#F88C14 +highlight markdownRule guifg=#808080 +highlight markdownBold guifg=#CCE0D0 gui=bold +highlight markdownItalic guifg=#CCE0D0 gui=italic +highlight markdownBoldItalic guifg=#CCE0D0 gui=bold,italic + +" YAML Groups +highlight yamlKey guifg=#7290B8 +highlight yamlBlockMappingKey guifg=#7290B8 +highlight yamlFlowMappingKey guifg=#7290B8 +highlight yamlKeyValueDelimiter guifg=#808080 +highlight yamlBlockCollectionItemStart guifg=#808080 +highlight yamlBool guifg=#F88C14 +highlight yamlNull guifg=#F88C14 +highlight yamlInteger guifg=#F88C14 +highlight yamlFloat guifg=#F88C14 +highlight yamlAnchor guifg=#88409C +highlight yamlAlias guifg=#88409C + +" Dockerfile Groups +highlight dockerfileKeyword guifg=#4068D4 +highlight dockerfileFrom guifg=#4068D4 gui=bold " Language-specific Groups highlight pythonBuiltinObj guifg=#F88C14 +highlight pythonBuiltinFunc guifg=#7290B8 gui=bold +highlight pythonBuiltinType guifg=#2CB494 highlight pythonDottedName guifg=#CCE0D0 +highlight pythonDecorator guifg=#88409C +highlight pythonDecoratorName guifg=#88409C + +highlight goBuiltins guifg=#7290B8 gui=bold +highlight goFormatSpecifier guifg=#88409C + +highlight javaScriptFunction guifg=#4068D4 +highlight javaScriptMember guifg=#7290B8 +highlight typescriptBraces guifg=#CCE0D0 +highlight typescriptParens guifg=#CCE0D0 + +highlight shVariable guifg=#CCE0D0 +highlight shDerefSimple guifg=#CCE0D0 +highlight shCommandSub guifg=#7290B8 + highlight rubyInterpolation guifg=#88409C highlight rubyInterpolationDelimiter guifg=#88409C highlight rubyBlockParameter guifg=#CCE0D0 diff --git a/home/.zsh/prompt.zsh b/home/.zsh/prompt.zsh index 5567c4d..e8b09f3 100644 --- a/home/.zsh/prompt.zsh +++ b/home/.zsh/prompt.zsh @@ -13,23 +13,44 @@ _dots_init_colors() { if [[ "$COLORTERM" == (truecolor|24bit) ]]; then _dots_pc=( teal $'%{\e[38;2;44;180;148m%}' + teal_bg $'%{\e[48;2;44;180;148m%}' orange $'%{\e[38;2;248;140;20m%}' red $'%{\e[38;2;244;4;4m%}' grey $'%{\e[38;2;114;144;184m%}' + grey_bg $'%{\e[48;2;114;144;184m%}' + purple $'%{\e[38;2;136;64;156m%}' + purple_bg $'%{\e[48;2;136;64;156m%}' + bright $'%{\e[38;2;204;224;208m%}' + dark $'%{\e[38;2;26;26;26m%}' + dark_bg $'%{\e[48;2;26;26;26m%}' ) elif [[ "$TERM" == *256color* ]]; then _dots_pc=( teal $'%{\e[38;5;43m%}' + teal_bg $'%{\e[48;5;43m%}' orange $'%{\e[38;5;208m%}' red $'%{\e[38;5;196m%}' grey $'%{\e[38;5;103m%}' + grey_bg $'%{\e[48;5;103m%}' + purple $'%{\e[38;5;133m%}' + purple_bg $'%{\e[48;5;133m%}' + bright $'%{\e[38;5;188m%}' + dark $'%{\e[38;5;234m%}' + dark_bg $'%{\e[48;5;234m%}' ) else _dots_pc=( teal $'%{\e[36m%}' + teal_bg $'%{\e[46m%}' orange $'%{\e[33m%}' red $'%{\e[31m%}' grey $'%{\e[34m%}' + grey_bg $'%{\e[44m%}' + purple $'%{\e[35m%}' + purple_bg $'%{\e[45m%}' + bright $'%{\e[37m%}' + dark $'%{\e[30m%}' + dark_bg $'%{\e[40m%}' ) fi _dots_pc[reset]=$'%{\e[0m%}' @@ -64,6 +85,7 @@ _dots_git_info_sync() { output=$(git status --short --branch --ignore-submodules=dirty 2>/dev/null) || return local branch="" ahead=0 behind=0 staged=0 unstaged=0 untracked=0 + local detached=0 # Parse efficiently: branch info from first line, counts from rest local first_line="${output%%$'\n'*}" @@ -72,8 +94,12 @@ _dots_git_info_sync() { if [[ "$first_line" == "## "* ]]; then branch="${first_line#\#\# }" # Handle detached HEAD - if [[ "$branch" == "HEAD (no branch)" || "$branch" == [0-9a-f]##* ]]; then + if [[ "$branch" == "HEAD (no branch)" ]]; then + branch=$(git rev-parse --short HEAD 2>/dev/null) + detached=1 + elif [[ "$branch" == [0-9a-f]##* ]]; then branch="${branch:0:7}" + detached=1 else # Remove tracking info branch="${branch%%...*}" @@ -105,37 +131,47 @@ _dots_git_info_sync() { unstaged=${counts[2]:-0} untracked=${counts[3]:-0} - local info="${_dots_pc[grey]}(${branch})${_dots_pc[reset]}" + # Branch pill: grey for main/master, inverted teal for feature, amber for detached + local branch_pill + if (( detached )); then + branch_pill="${_dots_pc[dark_bg]}${_dots_pc[dark]}(${_dots_pc[orange]}${branch}${_dots_pc[reset]}${_dots_pc[dark_bg]}${_dots_pc[dark]})${_dots_pc[reset]}" + elif [[ "$branch" == (main|master) ]]; then + branch_pill="${_dots_pc[dark_bg]}${_dots_pc[dark]}(${_dots_pc[grey]}${branch}${_dots_pc[reset]}${_dots_pc[dark_bg]}${_dots_pc[dark]})${_dots_pc[reset]}" + else + branch_pill="${_dots_pc[dark_bg]}${_dots_pc[dark]}(${_dots_pc[purple]}${_dots_pc[bold]}${branch}${_dots_pc[reset]}${_dots_pc[dark_bg]}${_dots_pc[dark]})${_dots_pc[reset]}" + fi + local info="$branch_pill" local dirty="" local sep="" if (( staged )); then - dirty+="${_dots_pc[teal]}+${staged}${_dots_pc[reset]}" + dirty+="${_dots_pc[teal]}+${staged}" sep=" " fi if (( unstaged )); then - dirty+="${sep}${_dots_pc[orange]}~${unstaged}${_dots_pc[reset]}" + dirty+="${sep}${_dots_pc[orange]}~${unstaged}" sep=" " fi if (( untracked )); then - dirty+="${sep}${_dots_pc[grey]}?${untracked}${_dots_pc[reset]}" + dirty+="${sep}${_dots_pc[grey]}?${untracked}" fi local arrows="" sep="" if (( ahead )); then - arrows+="${_dots_pc[teal]}↑${ahead}${_dots_pc[reset]}" + arrows+="${_dots_pc[teal]}↑${ahead}" sep=" " fi if (( behind )); then - arrows+="${sep}${_dots_pc[orange]}↓${behind}${_dots_pc[reset]}" + arrows+="${sep}${_dots_pc[orange]}↓${behind}" fi if [[ -n "$dirty" || -n "$arrows" ]]; then - info+=" " - [[ -n "$dirty" ]] && info+="$dirty" - [[ -n "$dirty" && -n "$arrows" ]] && info+=" " - [[ -n "$arrows" ]] && info+="$arrows" + local stats="" + [[ -n "$dirty" ]] && stats+="$dirty" + [[ -n "$dirty" && -n "$arrows" ]] && stats+=" " + [[ -n "$arrows" ]] && stats+="$arrows" + info+=" ${stats}" fi print -r -- "$info" @@ -155,7 +191,10 @@ _dots_git_async_callback() { _dots_git_info_result="$result" _dots_build_dots_prompt_base PROMPT="$_dots_prompt_base" - zle && zle reset-prompt + # Only reset prompt if not in a special ZLE widget (e.g. fzf) + if zle && [[ "${WIDGET:-}" != _dots_* ]]; then + zle reset-prompt 2>/dev/null + fi fi # Clean up exec {fd}<&- @@ -187,7 +226,7 @@ _dots_build_dots_prompt_base() { local symbol="${_dots_pc[grey]}${_dots_prompt_symbol}${_dots_pc[reset]}" (( EUID == 0 )) && symbol="${_dots_pc[orange]}${_dots_pc[bold]}#${_dots_pc[reset]}" - local line1="${_dots_pc[teal]}${dir_path}${_dots_pc[reset]}" + local line1="${_dots_pc[dark_bg]}${_dots_pc[dark]}#${_dots_pc[teal]}${dir_path}${_dots_pc[reset]}${_dots_pc[dark_bg]}${_dots_pc[dark]}#${_dots_pc[reset]}" [[ -n "$_dots_git_info_result" ]] && line1+=" ${_dots_git_info_result}" _dots_prompt_base=$'\n'"${line1}"$'\n'"${symbol} " @@ -246,7 +285,7 @@ TRAPINT() { _dots_prompt_flashing=1 local git_part="" [[ -n "$_dots_git_info_result" ]] && git_part=" ${_dots_git_info_result}" - local flash_prompt=$'\n'"${_dots_pc[teal]}$(_dots_abbrev_path)${_dots_pc[reset]}${git_part}"$'\n'$'%{\e[48;2;248;140;20m\e[30m%}'"${_dots_prompt_symbol}"$' %{\e[0m%}' + local flash_prompt=$'\n'"${_dots_pc[dark_bg]}${_dots_pc[dark]}#${_dots_pc[teal]}$(_dots_abbrev_path)${_dots_pc[reset]}${_dots_pc[dark_bg]}${_dots_pc[dark]}#${_dots_pc[reset]}${git_part}"$'\n'$'%{\e[48;2;248;140;20m\e[30m%}'"${_dots_prompt_symbol}"$' %{\e[0m%}' PROMPT="$flash_prompt" zle reset-prompt zselect -t $PROMPT_FLASH_DELAY diff --git a/home/.zsh/widgets.zsh b/home/.zsh/widgets.zsh index 484fd9d..aa9c14e 100644 --- a/home/.zsh/widgets.zsh +++ b/home/.zsh/widgets.zsh @@ -30,7 +30,7 @@ _dots_load_keybindings() { _dots_edit_widget() { local file file="$(rg --files --hidden --glob '!.git' 2>/dev/null \ - | fzf --preview 'head -100 {}')" || { zle reset-prompt; return; } + | fzf --preview 'bat --color=always --style=numbers --line-range=:100 {} || head -100 {}')" || { zle reset-prompt; return; } BUFFER="${EDITOR:-vim} ${(q)file}" zle reset-prompt zle accept-line @@ -80,7 +80,7 @@ _dots_load_keybindings() { local selection selection="$(rg --color=always --line-number --no-heading --hidden --glob '!.git' '' 2>/dev/null \ | fzf --ansi --delimiter=: \ - --preview 'head -n $((({2}+30))) {1} | tail -n 60' \ + --preview 'n={2}; n=${n:-1}; bat --color=always --style=numbers --highlight-line=$n --line-range=$((n>30?n-30:1)):$((n+30)) {1} 2>/dev/null || head -n $(( n + 30 )) {1} 2>/dev/null | tail -n 60' \ --preview-window='right:60%')" || { zle -I; zle reset-prompt; return; } local file="${selection%%:*}" local line="${${selection#*:}%%:*}" diff --git a/home/.zshrc b/home/.zshrc index 4dbeb7d..76811e0 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -22,13 +22,16 @@ _dots_cache_ls_colors() { if [[ -f "$cache_file" ]]; then source "$cache_file" else - if ls --color -d . &>/dev/null; then + if command -v gls &>/dev/null; then + echo 'alias ls="gls --color=auto"' > "$cache_file" + elif ls --color -d . &>/dev/null 2>&1; then echo 'alias ls="ls --color=auto"' > "$cache_file" - elif ls -G -d . &>/dev/null; then + elif ls -G -d . &>/dev/null 2>&1; then echo 'alias ls="ls -G"' > "$cache_file" fi [[ -f "$cache_file" ]] && source "$cache_file" fi + export LS_COLORS='di=38;2;44;180;148:ln=38;2;136;64;156:ex=38;2;248;140;20:fi=0:no=0:*.md=38;2;114;144;184:*.json=38;2;114;144;184:*.yml=38;2;114;144;184:*.yaml=38;2;114;144;184:*.toml=38;2;114;144;184' } _dots_cache_ls_colors @@ -53,6 +56,14 @@ _dots_init_completion() { else compinit fi + + # Completion styling + zstyle ':completion:*' menu select + zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" + zstyle ':completion:*' group-name '' + zstyle ':completion:*:descriptions' format $'\e[38;2;114;144;184m-- %d --\e[0m' + zstyle ':completion:*:warnings' format $'\e[38;2;244;4;4m-- no matches --\e[0m' + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' } _dots_init_completion @@ -60,9 +71,32 @@ _dots_load_plugins() { local plugin_dir="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins" local f="$plugin_dir/zsh-autosuggestions/zsh-autosuggestions.zsh" [[ -f "$f" ]] && source "$f" + + # Autosuggestion ghost text colour + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#3c3c3c' + # syntax-highlighting must be sourced last f="$plugin_dir/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" [[ -f "$f" ]] && source "$f" + + # Syntax highlighting theme + typeset -gA ZSH_HIGHLIGHT_STYLES + ZSH_HIGHLIGHT_STYLES[command]='fg=#2cb494' + ZSH_HIGHLIGHT_STYLES[builtin]='fg=#2cb494' + ZSH_HIGHLIGHT_STYLES[alias]='fg=#2cb494' + ZSH_HIGHLIGHT_STYLES[function]='fg=#2cb494' + ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#f40404' + ZSH_HIGHLIGHT_STYLES[path]='underline' + ZSH_HIGHLIGHT_STYLES[globbing]='fg=#f88c14' + ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#728cb8' + ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#728cb8' + ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#728cb8' + ZSH_HIGHLIGHT_STYLES[comment]='fg=#808080' + ZSH_HIGHLIGHT_STYLES[arg0]='fg=#2cb494' + ZSH_HIGHLIGHT_STYLES[default]='fg=#CCE0D0' + ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#808080' + ZSH_HIGHLIGHT_STYLES[redirection]='fg=#f88c14' + ZSH_HIGHLIGHT_STYLES[option]='fg=#7290b8' } _dots_load_plugins @@ -83,7 +117,7 @@ _dots_load_fzf() { command -v fzf &>/dev/null || return export FZF_DEFAULT_COMMAND='rg --files --hidden --glob "!.git"' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" - export FZF_DEFAULT_OPTS='--layout=reverse --height=40% --prompt="> " --info=inline-right --no-separator --margin=1,0,0,0' + export FZF_DEFAULT_OPTS='--style=minimal --layout=reverse --height=40% --border=none --no-scrollbar --prompt="> " --info=inline-right --no-separator --margin=1,0,0,0 --color=fg:#808080,fg+:#CCE0D0,bg:-1,bg+:#1a1a1a --color=hl:#2cb494,hl+:#2cb494,info:#808080,marker:#2cb494 --color=prompt:#2cb494,spinner:#88409C,pointer:#2cb494,header:#808080 --color=border:#3c3c3c,preview-border:#3c3c3c,gutter:#1a1a1a,preview-fg:#CCE0D0' # fzf --zsh requires v0.48+ if fzf --zsh &>/dev/null; then source <(fzf --zsh)