Merge branch main into origin/nixos-23.05

This commit is contained in:
teutat3s 2023-06-28 19:20:11 +02:00
parent a2733eee73
commit 2b9def0a76
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
17 changed files with 366 additions and 1234 deletions

View file

@ -59,7 +59,7 @@
# allowUnfree = true; # allowUnfree = true;
}; };
supportedSystems = ["x86_64-linux" "aarch64-linux"]; supportedSystems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"];
channels = { channels = {
nixos = { nixos = {

View file

@ -0,0 +1,107 @@
{
config,
pkgs,
self,
...
}: let
psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in {
enable = true;
historyControl = ["ignorespace"];
# Run when initializing a login shell
profileExtra = ''
[ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.sway-service}/bin/sway-service
'';
# Run when initializing an interactive shell
initExtra = ''
# Show current directory at the top in Alacritty
PROMPT_COMMAND='echo -e -n "\e]2;$(basename "$PWD")\e\\"'
# If a command is not found, show me where it is
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
# Helps you navigate directories faster
# https://github.com/gsamokovarov/jump
eval "$(${pkgs.jump}/bin/jump shell --bind=z)"
eval "$(${pkgs.direnv}/bin/direnv hook bash)"
bind 'set show-all-if-ambiguous on'
# Syntax highlighting, auto suggestions, vim modes, etc.
# https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs
source "$(blesh-share)" --attach=none
# ctrl + space to accept autocomplete suggestion
ble-bind -m 'auto_complete' -f 'C-@' 'auto_complete/insert-on-end'
# Meta (Alt) + Backspace to delete a word
ble-bind -m 'vi_imap' -f 'M-C-?' 'kill-backward-cword'
# Meta (Alt) + p to jump one word backwards
ble-bind -m 'vi_imap' -f M-p '@nomarked backward-uword'
ble-bind -m 'vi_imap' -f M-left '@nomarked backward-uword'
# Meta (Alt) + n to jump one word forwards
ble-bind -m 'vi_imap' -f M-n '@nomarked forward-uword'
ble-bind -m 'vi_imap' -f M-right '@nomarked forward-uword'
# Arrow up and Ctrl + p searches history for entered input
ble-bind -m 'vi_imap' -f up 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end'
ble-bind -m 'vi_imap' -f C-p 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end'
# Arrow down and Ctrl + n searches history for entered input
ble-bind -m 'vi_imap' -f down 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end'
ble-bind -m 'vi_imap' -f C-n 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end'
ble-face region_insert='fg=black,bg=navy'
function my/complete-load-hook {
bleopt complete_auto_delay=250
}
blehook/eval-after-load complete my/complete-load-hook
bleopt exec_errexit_mark=
bleopt filename_ls_colors="$LS_COLORS"
bleopt complete_menu_style=desc
# Bash vim mode keybindings
if [[ $- == *i* ]]; then # in interactive session
set -o vi
ble-bind -m vi_imap -f 'ENTER' 'vi_imap/complete'
ble-bind -m vi_imap -f 'TAB' 'vi_imap/complete'
ble-bind -m vi_imap -f 'j j' 'vi_imap/normal-mode'
ble-bind -m vi_imap -f 'ESC' 'vi_imap/normal-mode'
ble-bind -m vi_nmap -f 'h' 'vi_nmap/insert-mode'
ble-bind -m vi_nmap -f 'i' 'vi-command/backward-line'
ble-bind -m vi_nmap -f 'j' 'vi-command/backward-char'
ble-bind -m vi_nmap -f 'k' 'vi-command/forward-line'
ble-bind -m vi_nmap -f 'l' 'vi-command/forward-char'
ble-bind -m vi_imap -f 'C-c' discard-line
fi
# end of .bashrc
[[ ''${BLE_VERSION-} ]] && ble-attach
'';
shellAliases = {
nano = "nvim";
vi = "nvim";
vim = "nvim";
mutt = "neomutt";
ls = "exa";
la = "exa --group-directories-first -lag";
fm = "vifm .";
vifm = "vifm .";
wget = "wget --hsts-file=$XDG_CACHE_HOME/wget-hsts";
irssi = "irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_DATA_HOME/irssi";
drone = "DRONE_TOKEN=$(secret-tool lookup drone token) drone";
no = "manix \"\" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview=\"manix '{}'\" | xargs manix";
# fix nixos-option
nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat";
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
};
}

View file

@ -24,28 +24,29 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.command-not-found.enable = false; programs.command-not-found.enable = false;
# Needed to get zsh completion for system packages (e.g. systemd).
environment.pathsToLink = ["/share/zsh"];
environment.shells = with pkgs; [
zsh
];
programs.zsh.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
screen screen
]; ];
# Starship is a fast and featureful shell prompt
# starship.toml has sane defaults that can be changed there
programs.starship = {
enable = true;
settings = import ./starship.toml.nix;
};
home-manager = with pkgs; home-manager = with pkgs;
pkgs.lib.setAttrByPath ["users" psCfg.user.name] { pkgs.lib.setAttrByPath ["users" psCfg.user.name] {
home.packages = [ home.packages = [
ack ack
asciinema asciinema
bat bat
blesh
exa exa
fd fd
gh gh
glow glow
jump
nnn nnn
powerline powerline
silver-searcher silver-searcher
@ -53,19 +54,19 @@ in {
watson watson
]; ];
programs.neovim = import ./nvim { programs.bash = import ./bash {
inherit config; inherit config;
inherit pkgs; inherit pkgs;
inherit lib; inherit self;
}; };
programs.fzf = import ./fzf { programs.fzf = import ./fzf {
inherit config; inherit config;
inherit pkgs; inherit pkgs;
}; };
programs.zsh = import ./zsh { programs.neovim = import ./nvim {
inherit config; inherit config;
inherit pkgs; inherit pkgs;
inherit self; inherit lib;
}; };
}; };
}; };

View file

@ -10,5 +10,8 @@
"--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062" "--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062"
"--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7" "--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7"
]; ];
enableZshIntegration = true; # Use ble.sh for completions, see
# modules/terminal-life/bash/default.nix -> bleopt complete_menu_style=desc
# and https://github.com/akinomyoga/ble.sh/wiki/Manual-%C2%A77-Completion
enableBashIntegration = false;
} }

View file

@ -1,4 +1,4 @@
let g:base16_shell_path = $XDG_CONFIG_HOME . "/zsh/base16.sh" let g:base16_shell_path = $XDG_DATA_HOME . "/scripts/base16.sh"
let base16colorspace = 256 let base16colorspace = 256
set termguicolors set termguicolors
let g:sonokai_style = 'shusia' let g:sonokai_style = 'shusia'

View file

@ -0,0 +1,169 @@
{
format = "$username$hostname$directory($git_branch$git_commit$git_state$git_status)($c$deno$golang$haskell$nodejs$php$python$ruby$rust$terraform[](fg:#F85E84 bg:#000000))($docker_context[](fg:#06969A))($container)$fill(\${custom.triton})$nix_shell$status[ |](fg:#F85E84)$line_break$character";
# Disable the blank line at the start of the prompt
add_newline = false;
# You can also replace your username with a neat symbol like  to save some space
username = {
style_user = "bg:#000000 fg:#F85E84";
style_root = "bg:#F85E84 fg:#000000";
format = ''[$user ]($style)'';
};
hostname = {
ssh_symbol = "";
trim_at = "";
style = "bg:#000000 fg:#F85E84";
};
character = {
success_symbol = "[](bold purple)";
error_symbol = "[](#FF4B00)";
};
status = {
disabled = false;
style = "#FF4B00";
};
fill = {
symbol = "-";
#style = "bold green";
style = "black";
};
directory = {
style = "#F85E84";
truncate_to_repo = false;
fish_style_pwd_dir_length = 1;
truncation_symbol = "/";
format = "[](fg:black bg:#F85E84)[$path[$read_only](bg:$style fg:black)](bg:$style fg:black)[](fg:$style)";
read_only = " ";
};
# Here is how you can shorten some long paths by text replacement
# similar to mapped_locations in Oh My Posh:
directory.substitutions = {
"Documents" = " ";
"Downloads" = " ";
"Music" = " ";
"Pictures" = " ";
};
# Keep in mind that the order matters. For example:
# "Important Documents" = "  "
# will not be replaced, because "Documents" was already substituted before.
# So either put "Important Documents" before "Documents" or use the substituted version:
# "Important  " = "  "
c = {
symbol = " ";
style = "bg:#86BBD8";
format = ''[ $symbol ($version) ]($style)'';
};
#container = {};
custom = {
triton = {
command = "echo $TRITON_PROFILE";
when = "test $TRITON_PROFILE";
format = "[ ](fg:#F85E84 bg:#1A181A)[$output](fg:#F85E84 bg:#1A181A)";
description = "The current triton profile";
};
};
docker_context = {
symbol = " ";
style = "bg:#06969A";
format = ''[ $symbol $context ]($style) $path'';
};
#deno = {};
git_branch = {
style = "#E5C463";
format = "[](fg:black bg:$style)[ $symbol$branch](fg:black bg:$style)[](fg:$style)";
symbol = " ";
};
git_commit = {
style = "#E5C463";
# ^H is the literal backspace character which renders to \b in the final
# starship config TOML, produced in insert mode via ctrl+v then ctrl+h.
# We use the literal character, because escaping a single \ doesn't work
# with pkgs.formats.toml, see: https://github.com/NixOS/nixpkgs/issues/97310 and
# https://jdhao.github.io/2020/10/07/nvim_insert_unicode_char/
format = "[ ](bg:$style)[\\($hash$tag\\)](fg:black bg:$style)[](fg:$style)";
};
git_state = {
style = "#E5C463";
format = "[ ](bg:$style)[ \\($state( $progress_current/$progress_total)\\)](fg:black bg:$style)[](fg:$style)";
};
git_status = {
style = "#E5C463";
format = "([ ](bg:$style fg:black)$conflicted$staged$modified$renamed$deleted$untracked$stashed$ahead_behind[](fg:$style))";
conflicted = "[ ](bold fg:88 bg:#E5C463)[ \${count} ](fg:black bg:#E5C463)";
staged = "[ $count ](fg:black bg:#E5C463)";
modified = "[ \${count} ](fg:black bg:#E5C463)";
renamed = "[ \${count} ](fg:black bg:#E5C463)";
deleted = "[ \${count} ](fg:black bg:#E5C463)";
untracked = "[?\${count} ](fg:black bg:#E5C463)";
stashed = "[ \${count} ](fg:black bg:#E5C463)";
ahead = "[ \${count} ](fg:#523333 bg:#E5C463)";
behind = "[ \${count} ](fg:black bg:#E5C463)";
diverged = "[ ](fg:88 bg:#E5C463)[ ](fg:black bg:#E5C463)[ \${ahead_count} ](fg:black bg:#E5C463)[ \${behind_count} ](fg:black bg:#E5C463)";
};
golang = {
symbol = " ";
style = "bg:#86BBD8";
format = ''[ $symbol ($version) ]($style)'';
};
haskell = {
symbol = " ";
style = "bg:#86BBD8";
format = ''[ $symbol ($version) ]($style)'';
};
nix_shell = {
format = ''[$symbol]($style) '';
symbol = " ";
};
nodejs = {
symbol = "";
style = "bg:#86BBD8";
format = ''[ $symbol ($version) ]($style)'';
};
php = {
symbol = " ";
};
python = {
symbol = " ";
};
ruby = {
symbol = " ";
};
rust = {
symbol = "";
style = "bg:#86BBD8";
format = ''[ $symbol ($version) ]($style)'';
};
#terraform = {};
time = {
disabled = false;
time_format = "%R"; # Hour:Minute Format
style = "bg:#33658A";
format = ''[ $time ]($style)'';
};
}

View file

@ -1,123 +0,0 @@
{
config,
pkgs,
self,
...
}: let
psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
dotDir = ".config/zsh";
history = {
ignoreDups = true;
expireDuplicatesFirst = true;
ignoreSpace = true;
path = "$HOME/.local/share/zsh/zsh_history";
save = 10000;
size = 10000;
};
loginExtra = ''
[ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.sway-service}/bin/sway-service
'';
shellAliases = {
nano = "nvim";
vi = "nvim";
vim = "nvim";
mutt = "neomutt";
ls = "exa";
la = "exa --group-directories-first -lag";
fm = "vifm .";
vifm = "vifm .";
wget = "wget --hsts-file=$XDG_CACHE_HOME/wget-hsts";
irssi = "irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_DATA_HOME/irssi";
drone = "DRONE_TOKEN=$(secret-tool lookup drone token) drone";
no = "manix \"\" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview=\"manix '{}'\" | xargs manix";
# fix nixos-option
nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat";
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
};
plugins = [
# src gets fetched by nvfetcher, see: ./pkgs/sources.toml
{
# will source ohmyzsh/plugins/z/
name = "zsh-plugins-z";
file = "plugins/z/z.plugin.zsh";
src = pkgs.sources.ohmyzsh.src;
}
{
name = "zsh-powerlevel10k";
file = "powerlevel10k.zsh-theme";
src = pkgs.sources.powerlevel10k.src;
}
{
name = "zsh-fast-syntax-highlighting";
file = "F-Sy-H.plugin.zsh";
src = pkgs.sources.F-Sy-H.src;
}
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.sources.zsh-nix-shell.src;
}
];
initExtra =
''
bindkey -v
bindkey -v 'jj' vi-cmd-mode
bindkey -a 'i' up-line
bindkey -a 'k' down-line
bindkey -a 'j' backward-char
bindkey -a 'h' vi-insert
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
bindkey '^R' history-incremental-pattern-search-backward
bindkey '^ ' autosuggest-accept
bindkey '^q' push-line-or-edit
bindkey '^R' fzf-history-widget
# ArrowUp/Down start searching history with current input
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search
bindkey "^P" up-line-or-beginning-search
bindkey "^N" down-line-or-beginning-search
# MAKE CTRL+S WORK IN VIM
stty -ixon
stty erase '^?'
precmd () {
DIR_NAME=$(pwd | sed "s|^$HOME|~|g")
echo -e -n "\e]2;$DIR_NAME\e\\"
if [ $(date +%d%m) = '0104' ]; then
if [ $? -eq 0 ]; then
echo "Success! That was a great command! I can't wait to see what amazing stuff you'll be up to next."
fi
fi
}
# If a command is not found, show me where it is
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
''
+ builtins.readFile ./base16.zsh
+ builtins.readFile ./p10k.zsh
+ ''
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
source ${pkgs.fzf}/share/fzf/completion.zsh
source ${pkgs.git-bug}/share/zsh/site-functions/git-bug
eval "$(direnv hook zsh)"
''
+ builtins.readFile ./fzf.zsh;
}

View file

@ -1,58 +0,0 @@
# Use ~~ as the trigger sequence instead of the default **
export FZF_COMPLETION_TRIGGER='~~'
# Options to fzf command
export FZF_COMPLETION_OPTS='--border --info=inline'
__fzfcmd() {
echo "fzf"
}
# ctrl+r - Paste the selected command from history into the command line
fzf-history-widget() {
local selected num
setopt localoptions noglobsubst noposixbuiltins pipefail HIST_FIND_NO_DUPS 2> /dev/null
selected=( $(fc -rl 1 |
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) )
local ret=$?
if [ -n "$selected" ]; then
num=$selected[1]
if [ -n "$num" ]; then
zle vi-fetch-history -n $num
fi
fi
zle redisplay
typeset -f zle-line-init >/dev/null && zle zle-line-init
return $ret
}
zle -N fzf-history-widget
bindkey '^R' fzf-history-widget
# Use fd (https://github.com/sharkdp/fd) instead of the default find
# command for listing path candidates.
# - The first argument to the function ($1) is the base path to start traversal
# - See the source code (completion.{bash,zsh}) for the details.
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
# (EXPERIMENTAL) Advanced customization of fzf options via _fzf_comprun function
# - The first argument to the function is the name of the command.
# - You should make sure to pass the rest of the arguments to fzf.
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf "$@" --preview 'tree -C {} | head -200' ;;
export|unset) fzf "$@" --preview "eval 'echo \$'{}" ;;
ssh) fzf "$@" --preview 'dig {}' ;;
*) fzf "$@" ;;
esac
}

View file

@ -1,943 +0,0 @@
# Generated by Powerlevel10k configuration wizard on 2020-04-18 at 01:15 CEST.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 30399.
# Wizard options: powerline, classic, unicode, darkest, 24h time, angled separators,
# sharp heads, sharp tails, 1 line, compact, concise, transient_prompt,
# instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
#
# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done
# Temporarily change options.
'builtin' 'local' '-a' 'p10k_config_opts'
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
() {
emulate -L zsh -o extended_glob
# Unset all configuration options. This allows you to apply configuration changes without
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
unset -m 'POWERLEVEL9K_*'
# Zsh >= 5.1 is required.
autoload -Uz is-at-least && is-at-least 5.1 || return
# The list of segments shown on the left. Fill it with the most important segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
ssh
context
dir # current directory
vcs # git status
# prompt_char # prompt symbol
)
# The list of segments shown on the right. Fill it with less important segments.
# Right prompt on the last prompt line (where you are typing your commands) gets
# automatically hidden when the input line reaches it. Right prompt above the
# last prompt line gets hidden if it would overlap with left prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
status # exit code of the last command
command_execution_time # duration of the last command
background_jobs # presence of background jobs
direnv # direnv status (https://direnv.net/)
vim_shell # vim shell indicator (:sh)
triton # show the current triton profile
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
watson
# kubecontext # current kubernetes context (https://kubernetes.io/)
# terraform # terraform workspace (https://www.terraform.io)
# aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
# aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
# azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
# gcloud # google cloud cli account and project (https://cloud.google.com/)
# google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
# context # user@hostname
# ranger # ranger shell (https://github.com/ranger/ranger)
# nnn # nnn shell (https://github.com/jarun/nnn)
# midnight_commander # midnight commander shell (https://midnight-commander.org/)
# vpn_ip # virtual private network indicator
# load # CPU load
# disk_usage # disk usage
# ram # free RAM
# swap # used swap
# todo # todo items (https://github.com/todotxt/todo.txt-cli)
# timewarrior # timewarrior tracking status (https://timewarrior.net/)
# taskwarrior # taskwarrior task count (https://taskwarrior.org/)
# time # current time
# ip # ip address and bandwidth usage for a specified network interface
# public_ip # public IP address
# proxy # system-wide http/https/ftp proxy
# battery # internal battery
# wifi # wifi speed
# example # example user-defined segment (see prompt_example function below)
)
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND="black"
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND="yellow"
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=""
typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING="CMD"
# Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
typeset -g POWERLEVEL9K_MODE=powerline
# When set to `moderate`, some icons will have an extra space after them. This is meant to avoid
# icon overlap when using non-monospace fonts. When set to `none`, spaces are not added.
typeset -g POWERLEVEL9K_ICON_PADDING=none
# When set to true, icons appear before content on both sides of the prompt. When set
# to false, icons go after content. If empty or not set, icons go before content in the left
# prompt and after content in the right prompt.
#
# You can also override it for a specific segment:
#
# POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false
#
# Or for a specific segment in specific state:
#
# POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false
typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=
# Add an empty line before each prompt.
typeset -g POWERLEVEL9K_PROMPT_ON_NEWLINE=true
typeset -g POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
# Connect left prompt lines with these symbols. You'll probably want to use the same color
# as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%238F'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%238F '
# Connect right prompt lines with these symbols.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%238F'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%238F'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%238F'
# Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or
# '─'. The last two make it easier to see the alignment between left and right prompt and to
# separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
# for more compact prompt if using using this option.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=
if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
# The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE
# ornaments defined above.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238
# Start filler from the edge of the screen if there are no left segments on the first line.
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
# End filler on the edge of the screen if there are no right segments on the first line.
typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}'
fi
# Default background color.
typeset -g POWERLEVEL9K_BACKGROUND=none
# Separator between same-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%242F\uE0B1'
# Separator between same-color segments on the right.
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%242F\uE0B3'
# Separator between different-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0'
# Separator between different-color segments on the right.
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2'
# The right end of left prompt.
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
# The left end of right prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
# The left end of left prompt.
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
# The right end of right prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
# Left prompt terminator for lines without any segments.
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=
#################################[ os_icon: os identifier ]##################################
# OS identifier color.
typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=255
# Custom icon.
# typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐'
################################[ prompt_char: prompt symbol ]################################
# Transparent background.
typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=
# Green prompt symbol if the last command succeeded.
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=1
# Red prompt symbol if the last command failed.
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=17
# Default prompt symbol.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION=''
# Prompt symbol in command vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION=''
# Prompt symbol in visual vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION=''
# Prompt symbol in overwrite vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
# No line terminator if prompt_char is the last segment.
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=
# No line introducer if prompt_char is the first segment.
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
# No surrounding whitespace.
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE=
##################################[ dir: current directory ]##################################
typeset -g POWERLEVEL9K_{ETC,FOLDER,HOME,HOME_SUB}_ICON=
typeset -g POWERLEVEL9K_DIR_{ETC,HOME,HOME_SUBFOLDER,DEFAULT,NOT_WRITABLE}_BACKGROUND=1
typeset -g POWERLEVEL9K_DIR_{ETC,HOME,HOME_SUBFOLDER,DEFAULT,NOT_WRITABLE}_FOREGROUND=0
typeset -g POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_VISUAL_IDENTIFIER_COLOR=17
typeset -g POWERLEVEL9K_DIR_{ETC,DEFAULT}_BACKGROUND=15
typeset -g POWERLEVEL9K_DIR_{HOME,HOME_SUBFOLDER}_BACKGROUND=1
typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_BACKGROUND=1
# If directory is too long, shorten some of its segments to the shortest possible unique
# prefix. The shortened directory can be tab-completed to the original.
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
# Color of the shortened directory segments.
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=0
# Color of the anchor directory segments. Anchor segments are never shortened. The first
# segment is always an anchor.
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=0
# Display anchor directory segments in bold.
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=false
# Don't shorten directories that contain any of these files. They are anchors.
local anchor_files=(
.bzr
.citc
.git
.hg
.node-version
.python-version
.go-version
.ruby-version
.lua-version
.java-version
.perl-version
.php-version
.tool-version
.shorten_folder_marker
.svn
.terraform
CVS
Cargo.toml
composer.json
go.mod
package.json
stack.yaml
)
typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})"
# If set to true, remove everything before the last (deepest) subdirectory that contains files
# matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is
# /foo/bar/git_repo/baz, prompt will display git_repo/baz. This assumes that /foo/bar/git_repo
# contains a marker (.git) and other directories don't.
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
# Don't shorten this many last directory segments. They are anchors.
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
# Shorten directory if it's longer than this even if there is space for it. The value can
# be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty,
# directory will be shortened only when prompt doesn't fit or when other parameters demand it
# (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below).
# If set to `0`, directory will always be shortened to its minimum length.
typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80
# When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this
# many columns for typing commands.
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
# When `dir` segment is on the last prompt line, try to shorten it enough to leave at least
# COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands.
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
# If set to true, embed a hyperlink into the directory. Useful for quickly
# opening a directory in the file manager simply by clicking the link.
# Can also be handy when the directory is shortened, as it allows you to see
# the full directory that was used in previous commands.
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
# Enable special styling for non-writable directories.
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=true
# Show this icon when the current directory is not writable. POWERLEVEL9K_DIR_SHOW_WRITABLE
# above must be set to true for this parameter to have effect.
typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='∅'
#####################################[ vcs: git status ]######################################
# Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon.
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
# Untracked files icon. It's really a question mark, your font isn't broken.
# Change the value of this parameter to show a different icon.
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
# Formatter for Git status.
#
# Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
#
# You can edit the function to customize how Git status looks.
#
# VCS_STATUS_* parameters are set by gitstatus plugin. See reference:
# https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh.
function my_git_formatter() {
emulate -L zsh
if [[ -n $P9K_CONTENT ]]; then
# If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from
# gitstatus plugin). VCS_STATUS_* parameters are not available in this case.
typeset -g my_git_format=$P9K_CONTENT
return
fi
if (( $1 )); then
# Styling for up-to-date Git status.
local meta='%0F' # grey foreground
local clean='%0F' # green foreground
local modified='%0F' # yellow foreground
local untracked='%0F' # blue foreground
local conflicted='%0F' # red foreground
else
# Styling for incomplete and stale Git status.
local meta='%0F' # grey foreground
local clean='%0F' # grey foreground
local modified='%0F' # grey foreground
local untracked='%0F' # grey foreground
local conflicted='%0F' # grey foreground
fi
local res
local where # branch or tag
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}"
where=${(V)VCS_STATUS_LOCAL_BRANCH}
elif [[ -n $VCS_STATUS_TAG ]]; then
res+="${meta}#"
where=${(V)VCS_STATUS_TAG}
fi
# If local branch name or tag is at most 32 characters long, show it in full.
# Otherwise show the first 12 … the last 12.
# Tip: To always show local branch name in full without truncation, delete the next line.
(( $#where > 32 )) && where[13,-13]="…"
res+="${clean}${where//\%/%%}" # escape %
# Display the current Git commit if there is no branch or tag.
# Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line.
[[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
# Show tracking branch name if it differs from local branch.
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape %
fi
# ⇣42 if behind the remote.
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}${VCS_STATUS_COMMITS_BEHIND}"
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}${VCS_STATUS_COMMITS_AHEAD}"
# ⇠42 if behind the push remote.
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}${VCS_STATUS_PUSH_COMMITS_BEHIND}"
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
# ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42.
(( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}${VCS_STATUS_PUSH_COMMITS_AHEAD}"
# *42 if have stashes.
(( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}"
# 'merge' if the repo is in an unusual state.
[[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}"
# ~42 if have merge conflicts.
(( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}"
# +42 if have staged changes.
(( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}"
# !42 if have unstaged changes.
(( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}"
# ?42 if have untracked files. It's really a question mark, your font isn't broken.
# See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon.
# Remove the next line if you don't want to see untracked files at all.
(( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}"
# "─" if the number of unstaged files is unknown. This can happen due to
# POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower
# than the number of files in the Git index, or due to bash.showDirtyState being set to false
# in the repository config. The number of staged and untracked files may also be unknown
# in this case.
(( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}"
typeset -g my_git_format=$res
}
functions -M my_git_formatter 2>/dev/null
# Don't count the number of unstaged, untracked and conflicted files in Git repositories with
# more than this many files in the index. Negative value means infinity.
#
# If you are working in Git repositories with tens of millions of files and seeing performance
# sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output
# of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's
# config: `git config bash.showDirtyState false`.
typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
# Multiple patterns can be combined with '|': '~|~/some/dir'.
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
# Disable the default Git status formatting.
typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
# Install our own Git status formatter.
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}'
typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}'
# Enable counters for staged, unstaged, etc.
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1
# Icon color.
typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=4
typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=4
# Custom icon.
typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION=
# Custom prefix.
# typeset -g POWERLEVEL9K_VCS_PREFIX='%244Fon '
# Show status of repositories of these types. You can add svn and/or hg if you are
# using them. If you do, your prompt may become slow even when your current directory
# isn't in an svn or hg reposotiry.
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
# These settings are used for respositories other than Git or when gitstatusd fails and
# Powerlevel10k has to fall back to using vcs_info.
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=0
typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=0
typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=3
typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=0
typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3
##########################[ status: exit code of the last command ]###########################
# Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and
# style them independently from the regular OK and ERROR state.
typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true
# Status on success. No content, just an icon. No need to show it if prompt_char is enabled as
# it will signify success by turning green.
typeset -g POWERLEVEL9K_STATUS_OK=true
typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔'
# Status when some part of a pipe command fails but the overall exit status is zero. It may look
# like this: 1|0.
typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔'
# Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
# it will signify error by turning red.
typeset -g POWERLEVEL9K_STATUS_ERROR=true
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'
# Status when the last command was terminated by a signal.
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160
# Use terse signal names: "INT" instead of "SIGINT(2)".
typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘'
# Status when some part of a pipe command fails and the overall exit status is also non-zero.
# It may look like this: 1|0.
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
###################[ command_execution_time: duration of the last command ]###################
# Show duration of the last command if takes longer than this many seconds.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
# Show this many fractional digits. Zero means round to seconds.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
# Execution time color.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0
# Duration format: 1d 2h 3m 4s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
# Custom icon.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION=
# Custom prefix.
# typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%244Ftook '
#######################[ background_jobs: presence of background jobs ]#######################
# Don't show the number of background jobs.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
# Background jobs color.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=37
# Custom icon.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='≡'
#######################[ direnv: direnv status (https://direnv.net/) ]########################
# Direnv color.
typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178
# Custom icon.
# typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
# Default asdf color. Only used to display tools for which there is no color override (see below).
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66
# There are four parameters that can be used to hide asdf tools. Each parameter describes
# conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at
# least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to
# hide a tool, it gets shown.
#
# Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and
# POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands:
#
# asdf local python 3.8.1
# asdf global python 3.8.1
#
# After running both commands the current python version is 3.8.1 and its source is "local" as
# it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false,
# it'll hide python version in this case because 3.8.1 is the same as the global version.
# POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't
# contain "local".
# Hide tool versions that don't come from one of these sources.
#
# Available sources:
#
# - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable"
# - local `asdf current` says "set by /some/not/home/directory/file"
# - global `asdf current` says "set by /home/username/file"
#
# Note: If this parameter is set to (shell local global), it won't hide tools.
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES.
typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global)
# If set to false, hide tool versions that are the same as global.
#
# Note: The name of this parameter doesn't reflect its meaning at all.
# Note: If this parameter is set to true, it won't hide tools.
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW.
typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false
# If set to false, hide tool versions that are equal to "system".
#
# Note: If this parameter is set to true, it won't hide tools.
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM.
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
# in the current directory, or its parent diretory, or its grandparent directory, and so on.
#
# Note: If this parameter is set to empty value, it won't hide tools.
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB.
#
# Example: Hide nodejs version when there is no package.json and no *.js files in the current
# directory, in `..`, in `../..` and so on.
#
# typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json'
typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB=
# Ruby version from asdf.
typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168
# typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar'
# Python version from asdf.
typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37
# typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar'
# Go version from asdf.
typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37
# typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar'
# Node.js version from asdf.
typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70
# typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar'
# Rust version from asdf.
typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37
# typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar'
# .NET Core version from asdf.
typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134
# typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar'
# Flutter version from asdf.
typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38
# typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar'
# Lua version from asdf.
typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32
# typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar'
# Java version from asdf.
typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32
# typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar'
# Perl version from asdf.
typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67
# typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar'
# Erlang version from asdf.
typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125
# typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar'
# Elixir version from asdf.
typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129
# typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar'
# Postgres version from asdf.
typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31
# typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar'
# PHP version from asdf.
typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99
# typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar'
# Haskell version from asdf.
typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
###########[ nix_shell ]###########
# # Nix shell color.
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=''
# Custom icon.
typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='nix'
###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]###########
# Text and color for normal (a.k.a. command) vi mode.
typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=CMD
typeset -g POWERLEVEL9K_VI_MODE_NORMAL_FOREGROUND=4
# Text and color for visual vi mode.
typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VIS
typeset -g POWERLEVEL9K_VI_MODE_VISUAL_FOREGROUND=3
# Text and color for overtype (a.k.a. overwrite and replace) vi mode.
typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVR
typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_FOREGROUND=2
# Text and color for insert vi mode.
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=
typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=7
##################################[ context: user@hostname ]##################################
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=17
# Context color in SSH without privileges.
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=7
# Default context color (no privileges, no SSH).
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=7
# Context format when running with privileges: bold user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m'
# Context format when in SSH without privileges: user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
# Default context format (no privileges, no SSH): user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
# Python virtual environment color.
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
# Don't show Python version next to the virtual environment name.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Custom icon.
# typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
#####################[ anaconda: conda environment (https://conda.io/) ]######################
# Anaconda environment color.
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
# Don't show Python version next to the anaconda environment name.
typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER=
# Custom icon.
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
# Pyenv color.
typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37
# Hide python version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global)
# If set to false, hide python version if it's the same as global:
# $(pyenv version-name) == $(pyenv global).
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide python version if it's equal to "system".
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
################[ goenv: go environment (https://github.com/syndbg/goenv) ]################
# Goenv color.
typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37
# Hide go version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global)
# If set to false, hide go version if it's the same as global:
# $(goenv version-name) == $(goenv global).
typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide go version if it's equal to "system".
typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]##########
# Nodenv color.
typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70
# Hide node version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global)
# If set to false, hide node version if it's the same as global:
# $(nodenv version-name) == $(nodenv global).
typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
# Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
# Custom icon.
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############
# Nodeenv color.
typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70
# Don't show Node version next to the environment name.
typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false
# Separate environment name from Node version only with a space.
typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER=
# Custom icon.
# typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
##############################[ node_version: node.js version ]###############################
# Node version color.
typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70
# Show node version only when in a directory tree containing package.json.
typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
# Custom icon.
# typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
#######################[ go_version: go version (https://golang.org) ]########################
# Go version color.
typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37
# Show go version only when in a go project subdirectory.
typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
# Custom icon.
# typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
#################[ rust_version: rustc version (https://www.rust-lang.org) ]##################
# Rust version color.
typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37
# Show rust version only when in a rust project subdirectory.
typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
# Custom icon.
# typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################
# .NET version color.
typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134
# Show .NET version only when in a .NET project subdirectory.
typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true
# Custom icon.
# typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
#####################[ php_version: php version (https://www.php.net/) ]######################
# PHP version color.
typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99
# Show PHP version only when in a PHP project subdirectory.
typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true
# Custom icon.
# typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
##########[ laravel_version: laravel php framework version (https://laravel.com/) ]###########
# Laravel version color.
typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161
# Custom icon.
# typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
####################[ java_version: java version (https://www.java.com/) ]####################
# Java version color.
typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32
# Show java version only when in a java project subdirectory.
typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true
# Show brief version.
typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false
# Custom icon.
# typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]####
# Package color.
typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117
# Package format. The following parameters are available within the expansion.
#
# - P9K_PACKAGE_NAME The value of `name` field in package.json.
# - P9K_PACKAGE_VERSION The value of `version` field in package.json.
#
# typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}'
# Custom icon.
# typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐'
#############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]##############
# Rbenv color.
typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168
# Hide ruby version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global)
# If set to false, hide ruby version if it's the same as global:
# $(rbenv version-name) == $(rbenv global).
typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide ruby version if it's equal to "system".
typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
#######################[ rvm: ruby version from rvm (https://rvm.io) ]########################
# Rvm color.
typeset -g POWERLEVEL9K_RVM_FOREGROUND=168
# Don't show @gemset at the end.
typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false
# Don't show ruby- at the front.
typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false
# Custom icon.
# typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############
# Fvm color.
typeset -g POWERLEVEL9K_FVM_FOREGROUND=38
# Custom icon.
# typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]###########
# Lua color.
typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32
# Hide lua version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global)
# If set to false, hide lua version if it's the same as global:
# $(luaenv version-name) == $(luaenv global).
typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide lua version if it's equal to "system".
typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################
# Java color.
typeset -g POWERLEVEL9K_JENV_FOREGROUND=32
# Hide java version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global)
# If set to false, hide java version if it's the same as global:
# $(jenv version-name) == $(jenv global).
typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide java version if it's equal to "system".
typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############
# Perl color.
typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67
# Hide perl version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global)
# If set to false, hide perl version if it's the same as global:
# $(plenv version-name) == $(plenv global).
typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide perl version if it's equal to "system".
typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
# Hide php version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global)
# If set to false, hide php version if it's the same as global:
# $(phpenv version-name) == $(phpenv global).
typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide php version if it's equal to "system".
typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true
# Custom icon.
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
# Haskell color.
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172
# Hide haskell version if it doesn't come from one of these sources.
#
# shell: version is set by STACK_YAML
# local: version is set by stack.yaml up the directory tree
# global: version is set by the implicit global project (~/.stack/global-project/stack.yaml)
typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local)
# If set to false, hide haskell version if it's the same as in the implicit global project.
typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true
# Custom icon.
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Example of a user-defined prompt segment. Function prompt_example will be called on every
# prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user.
#
# Type `p10k help segment` for documentation and a more sophisticated example.
function prompt_watson() {
local watson_status=$(watson status)
local noproject="No project started."
if [ "$watson_status" != "$noproject" ]; then
p10k segment -i "祥" -f yellow -t "$(echo $watson_status | awk '{print $2,$3}')"
else
p10k segment -i "⏾" -f red -t ""
fi
}
function prompt_triton() {
local triton_profile=$(echo $TRITON_PROFILE)
if [ "$triton_profile" != "" ]; then
p10k segment -f yellow -t "$(echo "✚" "$triton_profile")"
fi
}
# Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
# when accepting a command line. Supported values:
#
# - off: Don't change prompt when accepting a command line.
# - always: Trim down prompt when accepting a command line.
# - same-dir: Trim down prompt when accepting a command line unless this is the first command
# typed after changing current working directory.
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
# Instant prompt mode.
#
# - off: Disable instant prompt. Choose this if you've tried instant prompt and found
# it incompatible with your zsh configuration files.
# - quiet: Enable instant prompt and don't print warnings when detecting console output
# during zsh initialization. Choose this if you've read and understood
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
# - verbose: Enable instant prompt and print a warning when detecting console output during
# zsh initialization. Choose this if you've never tried instant prompt, haven't
# seen the warning, or if you are unsure what this all means.
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
# can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
# really need it.
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=false
# If p10k is already loaded, reload configuration.
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
(( ! $+functions[p10k] )) || p10k reload
}
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'

5
overlays/blesh.nix Normal file
View file

@ -0,0 +1,5 @@
final: prev: {
blesh = prev.blesh.overrideAttrs (oldAttrs: rec {
inherit (prev.sources.blesh-nvfetcher) version src;
});
}

View file

@ -1,17 +1,19 @@
# This file was generated by nvfetcher, please do not modify it manually. # This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: { fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{ {
F-Sy-H = { blesh-nvfetcher = {
pname = "F-Sy-H"; pname = "blesh-nvfetcher";
version = "899f68b52b6b86a36cd8178eb0e9782d4aeda714"; version = "f16c0d807c8e1fe26fa5d990b561829382cbdc72";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "z-shell"; owner = "akinomyoga";
repo = "F-Sy-H"; repo = "ble.sh";
rev = "899f68b52b6b86a36cd8178eb0e9782d4aeda714"; rev = "f16c0d807c8e1fe26fa5d990b561829382cbdc72";
fetchSubmodules = false; fetchSubmodules = true;
sha256 = "sha256-zhaXjrNL0amxexbZm4Kr5Y/feq1+2zW0O6eo9iZhmi0="; deepClone = false;
leaveDotGit = true;
sha256 = "sha256-+tcM1z9uD7WXA7CfHmTbcPRcZfmXZ+Y7y6Bj4QA3f+4=";
}; };
date = "2023-01-25"; date = "2023-06-12";
}; };
instant-nvim-nvfetcher = { instant-nvim-nvfetcher = {
pname = "instant-nvim-nvfetcher"; pname = "instant-nvim-nvfetcher";
@ -37,30 +39,6 @@
}; };
date = "2021-04-20"; date = "2021-04-20";
}; };
ohmyzsh = {
pname = "ohmyzsh";
version = "cb8b677488c7a20278917af58dfccd72cd40e1b1";
src = fetchFromGitHub {
owner = "ohmyzsh";
repo = "ohmyzsh";
rev = "cb8b677488c7a20278917af58dfccd72cd40e1b1";
fetchSubmodules = false;
sha256 = "sha256-c7tGTEdE8e1qD83Nxzno1VLAFV5gKoB4TJes4aVa2mY=";
};
date = "2023-06-11";
};
powerlevel10k = {
pname = "powerlevel10k";
version = "944f52fc430259ff49f497f3516a3ddfb45a0a6b";
src = fetchFromGitHub {
owner = "romkatv";
repo = "powerlevel10k";
rev = "944f52fc430259ff49f497f3516a3ddfb45a0a6b";
fetchSubmodules = false;
sha256 = "sha256-a2HTHvvI6aQXe/tzvd0P1IGWFFo64fMeKNX3TxMvCcc=";
};
date = "2023-06-11";
};
rnix-lsp-nvfetcher = { rnix-lsp-nvfetcher = {
pname = "rnix-lsp-nvfetcher"; pname = "rnix-lsp-nvfetcher";
version = "95d40673fe43642e2e1144341e86d0036abd95d9"; version = "95d40673fe43642e2e1144341e86d0036abd95d9";
@ -133,16 +111,16 @@
}; };
date = "2022-07-03"; date = "2022-07-03";
}; };
zsh-nix-shell = { waybar-nvfetcher = {
pname = "zsh-nix-shell"; pname = "waybar-nvfetcher";
version = "227d284ab2dc2f5153826974e0094a1990b1b5b9"; version = "41164905351436db3a124207261f9dd759c6fa1b";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "chisui"; owner = "Alexays";
repo = "zsh-nix-shell"; repo = "Waybar";
rev = "227d284ab2dc2f5153826974e0094a1990b1b5b9"; rev = "41164905351436db3a124207261f9dd759c6fa1b";
fetchSubmodules = false; fetchSubmodules = false;
sha256 = "sha256-SrGvHsAJCxzi69CKNKKvItYUaAP7CKwRntsprVHBs4Y="; sha256 = "sha256-aogiOj4pe2AJYxQFh8Dw6xQ2Tb6v4W9zwbGX4t2mStI=";
}; };
date = "2023-05-29"; date = "2023-06-27";
}; };
} }

View file

@ -3,22 +3,6 @@
src.git = "https://github.com/mlvzk/manix" src.git = "https://github.com/mlvzk/manix"
fetch.github = "mlvzk/manix" fetch.github = "mlvzk/manix"
[ohmyzsh]
src.git = "https://github.com/ohmyzsh/ohmyzsh"
fetch.github = "ohmyzsh/ohmyzsh"
[powerlevel10k]
src.git = "https://github.com/romkatv/powerlevel10k"
fetch.github = "romkatv/powerlevel10k"
[F-Sy-H]
src.git = "https://github.com/z-shell/F-Sy-H"
fetch.github = "z-shell/F-Sy-H"
[zsh-nix-shell]
src.git = "https://github.com/chisui/zsh-nix-shell"
fetch.github = "chisui/zsh-nix-shell"
[rnix-lsp-nvfetcher] [rnix-lsp-nvfetcher]
src.git = "https://github.com/nix-community/rnix-lsp" src.git = "https://github.com/nix-community/rnix-lsp"
fetch.github = "nix-community/rnix-lsp" fetch.github = "nix-community/rnix-lsp"
@ -46,3 +30,13 @@ fetch.github = "zeekay/vim-beautify"
[vim-apprentice-nvfetcher] [vim-apprentice-nvfetcher]
src.git = "https://github.com/romainl/Apprentice" src.git = "https://github.com/romainl/Apprentice"
fetch.github = "romainl/Apprentice" fetch.github = "romainl/Apprentice"
[waybar-nvfetcher]
src.git = "https://github.com/Alexays/Waybar"
fetch.github = "Alexays/Waybar"
[blesh-nvfetcher]
src.git = "https://github.com/akinomyoga/ble.sh"
fetch.github = "akinomyoga/ble.sh"
git.fetchSubmodules = true
git.leaveDotGit = true

View file

@ -1,7 +1,6 @@
self: self:
with self; '' with self; ''
#!/usr/bin/env zsh #!/usr/bin/env bash
# terminal application launcher for sway, using fzf
# original command: # original command:
# Based on: https://github.com/swaywm/sway/issues/1367 # Based on: https://github.com/swaywm/sway/issues/1367
# bindsym $altkey+space exec termite --name=launcher -e \ # bindsym $altkey+space exec termite --name=launcher -e \
@ -12,7 +11,7 @@ with self; ''
# Get shell command list # Get shell command list
# This may include the occasional non-executable file # This may include the occasional non-executable file
command_list=$({ whence -wm '*' | sed 's/:[^:]*$//' }) command_list=$({ compgen -c | sed 's/:[^:]*$//'; })
# read existing command history # read existing command history
if [ -f "$HIST_FILE" ]; then if [ -f "$HIST_FILE" ]; then

View file

@ -3,28 +3,28 @@
# Base16 Shell template by Chris Kempson (http://chriskempson.com) # Base16 Shell template by Chris Kempson (http://chriskempson.com)
# Burn scheme by Benjamin Bädorf # Burn scheme by Benjamin Bädorf
color00="1a/18/1a" # Base 00 - Black color00="1a/18/1a" # Base 00 - Black
color01="f8/5e/84" # Base 08 - Red color01="f8/5e/84" # Base 08 - Red
color02="9e/cd/6f" # Base 0B - Green color02="9e/cd/6f" # Base 0B - Green
color03="e5/c4/63" # Base 0A - Yellow color03="e5/c4/63" # Base 0A - Yellow
color04="7a/cc/d7" # Base 0D - Blue color04="7a/cc/d7" # Base 0D - Blue
color05="ab/9d/f2" # Base 0E - Magenta color05="ab/9d/f2" # Base 0E - Magenta
color06="ef/90/62" # Base 0C - Cyan color06="ef/90/62" # Base 0C - Cyan
color07="e3/e1/e4" # Base 05 - White color07="e3/e1/e4" # Base 05 - White
color08="94/94/94" # Base 03 - Bright Black color08="94/94/94" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan color14=$color06 # Base 0C - Bright Cyan
color15="ff/5f/5f" # Base 07 - Bright White color15="ff/5f/5f" # Base 07 - Bright White
color16="df/59/23" # Base 09 color16="df/59/23" # Base 09
color17="d7/00/00" # Base 0F color17="d7/00/00" # Base 0F
color18="2d/2a/2e" # Base 01 color18="2d/2a/2e" # Base 01
color19="30/30/30" # Base 02 color19="30/30/30" # Base 02
color20="d3/d1/d4" # Base 04 color20="d3/d1/d4" # Base 04
color21="30/30/30" # Base 06 color21="30/30/30" # Base 06
color_foreground="e3/e1/e4" # Base 05 color_foreground="e3/e1/e4" # Base 05
color_background="1a/18/1a" # Base 00 color_background="1a/18/1a" # Base 00
@ -50,16 +50,16 @@ else
fi fi
# 16 color space # 16 color space
put_template 0 $color00 put_template 0 $color00
put_template 1 $color01 put_template 1 $color01
put_template 2 $color02 put_template 2 $color02
put_template 3 $color03 put_template 3 $color03
put_template 4 $color04 put_template 4 $color04
put_template 5 $color05 put_template 5 $color05
put_template 6 $color06 put_template 6 $color06
put_template 7 $color07 put_template 7 $color07
put_template 8 $color08 put_template 8 $color08
put_template 9 $color09 put_template 9 $color09
put_template 10 $color10 put_template 10 $color10
put_template 11 $color11 put_template 11 $color11
put_template 12 $color12 put_template 12 $color12

View file

@ -31,7 +31,6 @@ in {
if psCfg.user.password != null if psCfg.user.password != null
then psCfg.user.password then psCfg.user.password
else ""; else "";
shell = pkgs.zsh;
openssh.authorizedKeys.keys = openssh.authorizedKeys.keys =
if psCfg.user.publicKeys != null if psCfg.user.publicKeys != null
then psCfg.user.publicKeys then psCfg.user.publicKeys

View file

@ -26,7 +26,6 @@ in {
fonts.fontconfig.enable = mkForce true; fonts.fontconfig.enable = mkForce true;
programs.dircolors.enable = true; programs.dircolors.enable = true;
programs.dircolors.enableZshIntegration = true;
home.file."xinitrc".source = ./.xinitrc; home.file."xinitrc".source = ./.xinitrc;
@ -72,6 +71,8 @@ in {
# docker run -it --name caddy-json-schema registry.greenbaum.cloud/gc/caddy-l4:2.5.2 caddy json-schema -output /srv/caddy_schema.json # docker run -it --name caddy-json-schema registry.greenbaum.cloud/gc/caddy-l4:2.5.2 caddy json-schema -output /srv/caddy_schema.json
xdg.dataFile."nvim/json-schemas/caddy_schema.json".source = .local/share/nvim/json-schemas/caddy_schema.json; xdg.dataFile."nvim/json-schemas/caddy_schema.json".source = .local/share/nvim/json-schemas/caddy_schema.json;
xdg.dataFile."nvim/templates/.keep".text = ""; xdg.dataFile."nvim/templates/.keep".text = "";
xdg.dataFile."scripts/.keep".text = "";
xdg.dataFile."scripts/base16.sh".source = .local/share/scripts/base16.sh;
xdg.dataFile."shell.nix.tmpl" = { xdg.dataFile."shell.nix.tmpl" = {
text = '' text = ''
let let

View file

@ -8,7 +8,7 @@
nodes.test-machine = {suites ? null, ...}: { nodes.test-machine = {suites ? null, ...}: {
imports = suites.iso; imports = suites.iso;
home-manager.users.pub-solar.programs.zsh.shellAliases = { home-manager.users.pub-solar.programs.bash.shellAliases = {
test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok"; test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok";
test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok"; test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok";
}; };