├── Brewfile ├── dot_p10k.zsh └── dot_zshrc /Brewfile: -------------------------------------------------------------------------------- 1 | tap "buo/cask-upgrade" 2 | tap "cloudflare/cloudflare" 3 | tap "github/gh" 4 | tap "gmerlino/udffsck" 5 | tap "homebrew/bundle" 6 | tap "homebrew/services" 7 | tap "jesseduffield/lazydocker" 8 | tap "jesseduffield/lazygit" 9 | tap "localsend/localsend" 10 | tap "pouriyajamshidi/tap" 11 | tap "rfidresearchgroup/proxmark3" 12 | tap "teamookla/speedtest" 13 | brew "ack" 14 | brew "zstd" 15 | brew "argyll-cms" 16 | brew "aria2" 17 | brew "python@3.12" 18 | brew "glib" 19 | brew "automake" 20 | brew "axel" 21 | brew "bat" 22 | brew "bfg" 23 | brew "bind" 24 | brew "cabextract" 25 | brew "ccache" 26 | brew "chezmoi" 27 | brew "cmake" 28 | brew "coreutils" 29 | brew "dua-cli" 30 | brew "dufs" 31 | brew "dust" 32 | brew "fastfetch" 33 | brew "fd" 34 | brew "ffmpeg" 35 | brew "fnm" 36 | brew "libtool" 37 | brew "python@3.11" 38 | brew "fontforge" 39 | brew "fzf" 40 | brew "gawk" 41 | brew "gh" 42 | brew "git" 43 | brew "git-lfs" 44 | brew "gnu-sed" 45 | brew "libusb" 46 | brew "go" 47 | brew "jasper" 48 | brew "graphviz" 49 | brew "gtk+3" 50 | brew "gsmartcontrol" 51 | brew "htop" 52 | brew "jq" 53 | brew "lazygit" 54 | brew "libiconv" 55 | brew "llvm" 56 | brew "llvm@16" 57 | brew "mas" 58 | brew "mtr" 59 | brew "nano" 60 | brew "ncdu" 61 | brew "nexttrace" 62 | brew "ninja" 63 | brew "nmap" 64 | brew "openjdk@11" 65 | brew "pipx" 66 | brew "pkg-config" 67 | brew "protobuf" 68 | brew "pyenv" 69 | brew "pyenv-virtualenv" 70 | brew "python@3.10" 71 | brew "qemu" 72 | brew "ripgrep" 73 | brew "rye" 74 | brew "six" 75 | brew "stuntman" 76 | brew "t-rec" 77 | brew "telnet" 78 | brew "thefuck" 79 | brew "tree" 80 | brew "wgcf" 81 | brew "wget" 82 | brew "wget2" 83 | brew "whois" 84 | brew "zsh" 85 | brew "cloudflare/cloudflare/curl" 86 | brew "jesseduffield/lazydocker/lazydocker" 87 | brew "pouriyajamshidi/tap/tcping" 88 | brew "teamookla/speedtest/speedtest" 89 | cask "1password" 90 | cask "1password-cli" 91 | cask "android-platform-tools" 92 | cask "appcleaner" 93 | cask "balenaetcher" 94 | cask "betterdisplay" 95 | cask "discord" 96 | cask "emby" 97 | cask "eqmac" 98 | cask "exifcleaner" 99 | cask "firefox" 100 | cask "firefox@developer-edition" 101 | cask "font-jetbrains-mono" 102 | cask "font-jetbrains-mono-nerd-font" 103 | cask "font-monaspace" 104 | cask "gimp" 105 | cask "git-credential-manager" 106 | cask "google-chrome" 107 | cask "google-chrome@canary" 108 | cask "grandperspective" 109 | cask "hex-fiend" 110 | cask "hidock" 111 | cask "iina" 112 | cask "iterm2" 113 | cask "kap" 114 | cask "keka" 115 | cask "kekaexternalhelper" 116 | cask "latest" 117 | cask "localsend" 118 | cask "microsoft-auto-update" 119 | cask "microsoft-office" 120 | cask "minecraft" 121 | cask "moonlight" 122 | cask "motrix" 123 | cask "neteasemusic" 124 | cask "nrlquaker-winbox" 125 | cask "obsidian" 126 | cask "openmtp" 127 | cask "orbstack" 128 | cask "orion" 129 | cask "postman" 130 | cask "qlcolorcode" 131 | cask "qlimagesize" 132 | cask "qlmarkdown" 133 | cask "qlstephen" 134 | cask "qlvideo" 135 | cask "qlzipinfo" 136 | cask "quicklook-json" 137 | cask "quicklookase" 138 | cask "raspberry-pi-imager" 139 | cask "rectangle-pro" 140 | cask "reqable" 141 | cask "scroll-reverser" 142 | cask "setapp" 143 | cask "snipaste" 144 | cask "soduto" 145 | cask "surge" 146 | cask "switchhosts" 147 | cask "telegram" 148 | cask "temurin" 149 | cask "tencent-meeting" 150 | cask "termius" 151 | cask "typora" 152 | cask "uninstallpkg" 153 | cask "utm" 154 | cask "visual-studio-code" 155 | cask "webpquicklook" 156 | cask "wezterm" 157 | cask "wifiman" 158 | cask "windterm" 159 | cask "wireshark" 160 | cask "xquartz" 161 | mas "1Password for Safari", id: 1569813296 162 | mas "AdGuard for Safari", id: 1440147259 163 | mas "AmorphousDiskMark", id: 1168254295 164 | mas "AmorphousMemoryMark", id: 1495719766 165 | mas "CrystalFetch", id: 6454431289 166 | mas "Disk Speed Test", id: 425264550 167 | mas "FastZip", id: 1565629813 168 | mas "GarageBand", id: 682658836 169 | mas "iMovie", id: 408981434 170 | mas "Keynote", id: 409183694 171 | mas "Numbers", id: 409203825 172 | mas "NZBin", id: 979608899 173 | mas "OpenSpeedTest-Server", id: 1579499874 174 | mas "Pages", id: 409201541 175 | mas "Shareful", id: 1522267256 176 | mas "Tencent Lemon Lite", id: 1449962996 177 | mas "Velja", id: 1607635845 178 | mas "WeChat", id: 836500024 179 | vscode "antfu.smart-clicks" 180 | vscode "antfu.unocss" 181 | vscode "bashmish.es6-string-css" 182 | vscode "bradlc.vscode-tailwindcss" 183 | vscode "christian-kohler.path-intellisense" 184 | vscode "clinyong.vscode-css-modules" 185 | vscode "codesandbox-io.codesandbox-projects" 186 | vscode "csstools.postcss" 187 | vscode "dbaeumer.vscode-eslint" 188 | vscode "dgeibi.alias-tool" 189 | vscode "donjayamanne.githistory" 190 | vscode "dprint.dprint" 191 | vscode "dtsvet.vscode-wasm" 192 | vscode "eamodio.gitlens" 193 | vscode "editorconfig.editorconfig" 194 | vscode "equinusocio.vsc-community-material-theme" 195 | vscode "equinusocio.vsc-material-theme" 196 | vscode "equinusocio.vsc-material-theme-icons" 197 | vscode "esbenp.prettier-vscode" 198 | vscode "fabiospampinato.vscode-diff" 199 | vscode "flowtype.flow-for-vscode" 200 | vscode "github.copilot" 201 | vscode "github.copilot-chat" 202 | vscode "github.remotehub" 203 | vscode "github.vscode-github-actions" 204 | vscode "github.vscode-pull-request-github" 205 | vscode "golang.go" 206 | vscode "google.wireit" 207 | vscode "graphql.vscode-graphql" 208 | vscode "graphql.vscode-graphql-syntax" 209 | vscode "gruntfuggly.todo-tree" 210 | vscode "henoc.svgeditor" 211 | vscode "icrawl.discord-vscode" 212 | vscode "inferrinizzard.prettier-sql-vscode" 213 | vscode "jock.svg" 214 | vscode "lkrms.inifmt" 215 | vscode "lokalise.i18n-ally" 216 | vscode "magicstack.magicpython" 217 | vscode "meganrogge.template-string-converter" 218 | vscode "mintlify.document" 219 | vscode "mrmlnc.vscode-json5" 220 | vscode "ms-azuretools.vscode-docker" 221 | vscode "ms-python.debugpy" 222 | vscode "ms-python.python" 223 | vscode "ms-python.vscode-pylance" 224 | vscode "ms-toolsai.jupyter-renderers" 225 | vscode "ms-vscode-remote.remote-containers" 226 | vscode "ms-vscode-remote.remote-ssh" 227 | vscode "ms-vscode-remote.remote-ssh-edit" 228 | vscode "ms-vscode.azure-repos" 229 | vscode "ms-vscode.hexeditor" 230 | vscode "ms-vscode.makefile-tools" 231 | vscode "ms-vscode.remote-explorer" 232 | vscode "ms-vscode.remote-repositories" 233 | vscode "ms-vscode.vscode-github-issue-notebooks" 234 | vscode "ms-vscode.vscode-js-profile-flame" 235 | vscode "ms-vscode.vscode-typescript-next" 236 | vscode "ms-vsliveshare.vsliveshare" 237 | vscode "mxsdev.typescript-explorer" 238 | vscode "orta.vscode-jest" 239 | vscode "peakchen90.open-html-in-browser" 240 | vscode "pkief.material-icon-theme" 241 | vscode "prateekmahendrakar.prettyxml" 242 | vscode "prisma.prisma" 243 | vscode "rbuckton.deoptexplorer-vscode" 244 | vscode "redhat.vscode-commons" 245 | vscode "redhat.vscode-xml" 246 | vscode "redhat.vscode-yaml" 247 | vscode "ronnidc.nunjucks" 248 | vscode "ryu1kn.partial-diff" 249 | vscode "shd101wyy.markdown-preview-enhanced" 250 | vscode "streetsidesoftware.code-spell-checker" 251 | vscode "styled-components.vscode-styled-components" 252 | vscode "syler.sass-indented" 253 | vscode "tamasfe.even-better-toml" 254 | vscode "thog.vscode-asl" 255 | vscode "tlent.jest-snapshot-language-support" 256 | vscode "tobermory.es6-string-html" 257 | vscode "tzachovadia.todo-list" 258 | vscode "unifiedjs.vscode-mdx" 259 | vscode "usernamehw.errorlens" 260 | vscode "viijay-kr.react-ts-css" 261 | vscode "vivaxy.vscode-conventional-commits" 262 | vscode "vue.volar" 263 | vscode "vunguyentuan.vscode-css-variables" 264 | vscode "wakatime.vscode-wakatime" 265 | vscode "withfig.fig" 266 | vscode "xabikos.javascriptsnippets" 267 | vscode "yijie.vscode-comment-queries" 268 | vscode "yinfei.luahelper" 269 | vscode "yoavbls.pretty-ts-errors" 270 | vscode "yzhang.markdown-all-in-one" 271 | vscode "zhangciwu.swig-tpl" 272 | vscode "zjcompt.es6-string-javascript" 273 | -------------------------------------------------------------------------------- /dot_p10k.zsh: -------------------------------------------------------------------------------- 1 | # Generated by Powerlevel10k configuration wizard on 2021-12-01 at 04:47 CST. 2 | # Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 54401. 3 | # Wizard options: nerdfont-complete + powerline, small icons, ascii, lean, 24h time, 4 | # 2 lines, disconnected, sparse, concise, transient_prompt, instant_prompt=off. 5 | # Type `p10k configure` to generate another config. 6 | # 7 | # Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate 8 | # your own config based on it. 9 | # 10 | # Tip: Looking for a nice color? Here's a one-liner to print colormap. 11 | # 12 | # for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done 13 | 14 | # Temporarily change options. 15 | 'builtin' 'local' '-a' 'p10k_config_opts' 16 | [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') 17 | [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') 18 | [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') 19 | 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' 20 | 21 | () { 22 | emulate -L zsh -o extended_glob 23 | 24 | # Unset all configuration options. This allows you to apply configuration changes without 25 | # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. 26 | unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' 27 | 28 | # Zsh >= 5.1 is required. 29 | [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return 30 | 31 | # The list of segments shown on the left. Fill it with the most important segments. 32 | typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( 33 | # =========================[ Line #1 ]========================= 34 | time # current time 35 | os_icon # os identifier 36 | context # user@hostname 37 | dir # current directory 38 | vcs # git status 39 | # =========================[ Line #2 ]========================= 40 | newline # \n 41 | prompt_char # prompt symbol 42 | ) 43 | 44 | # The list of segments shown on the right. Fill it with less important segments. 45 | # Right prompt on the last prompt line (where you are typing your commands) gets 46 | # automatically hidden when the input line reaches it. Right prompt above the 47 | # last prompt line gets hidden if it would overlap with left prompt. 48 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( 49 | # =========================[ Line #1 ]========================= 50 | status # exit code of the last command 51 | command_execution_time # duration of the last command 52 | background_jobs # presence of background jobs 53 | # direnv # direnv status (https://direnv.net/) 54 | # asdf # asdf version manager (https://github.com/asdf-vm/asdf) 55 | virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) 56 | anaconda # conda environment (https://conda.io/) 57 | pyenv # python environment (https://github.com/pyenv/pyenv) 58 | goenv # go environment (https://github.com/syndbg/goenv) 59 | # nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) 60 | # nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) 61 | # nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) 62 | node_version # node.js version 63 | sukka_npm_type # defined in .zshrc 64 | # go_version # go version (https://golang.org) 65 | # rust_version # rustc version (https://www.rust-lang.org) 66 | # dotnet_version # .NET version (https://dotnet.microsoft.com) 67 | # php_version # php version (https://www.php.net/) 68 | # laravel_version # laravel php framework version (https://laravel.com/) 69 | # java_version # java version (https://www.java.com/) 70 | # package # name@version from package.json (https://docs.npmjs.com/files/package.json) 71 | # rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) 72 | # rvm # ruby version from rvm (https://rvm.io) 73 | # fvm # flutter version management (https://github.com/leoafarias/fvm) 74 | # luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) 75 | # jenv # java version from jenv (https://github.com/jenv/jenv) 76 | # plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 77 | # phpenv # php version from phpenv (https://github.com/phpenv/phpenv) 78 | # scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) 79 | # haskell_stack # haskell version from stack (https://haskellstack.org/) 80 | # kubecontext # current kubernetes context (https://kubernetes.io/) 81 | # terraform # terraform workspace (https://www.terraform.io) 82 | # terraform_version # terraform version (https://www.terraform.io) 83 | # aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) 84 | # aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) 85 | # azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) 86 | # gcloud # google cloud cli account and project (https://cloud.google.com/) 87 | # google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) 88 | # toolbox # toolbox name (https://github.com/containers/toolbox) 89 | # context # user@hostname 90 | # nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) 91 | # ranger # ranger shell (https://github.com/ranger/ranger) 92 | nnn # nnn shell (https://github.com/jarun/nnn) 93 | # xplr # xplr shell (https://github.com/sayanarijit/xplr) 94 | # vim_shell # vim shell indicator (:sh) 95 | # midnight_commander # midnight commander shell (https://midnight-commander.org/) 96 | # nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) 97 | # vpn_ip # virtual private network indicator 98 | load # CPU load 99 | # disk_usage # disk usage 100 | ram # free RAM 101 | # swap # used swap 102 | # todo # todo items (https://github.com/todotxt/todo.txt-cli) 103 | # timewarrior # timewarrior tracking status (https://timewarrior.net/) 104 | # taskwarrior # taskwarrior task count (https://taskwarrior.org/) 105 | # time # current time 106 | # =========================[ Line #2 ]========================= 107 | newline 108 | # ip # ip address and bandwidth usage for a specified network interface 109 | # public_ip # public IP address 110 | sukka_custom_ip # defined in .zshrc 111 | proxy # system-wide http/https/ftp proxy 112 | battery # internal battery 113 | wifi # wifi speed 114 | # example # example user-defined segment (see prompt_example function below) 115 | ) 116 | 117 | # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. 118 | typeset -g POWERLEVEL9K_MODE=nerdfont-v3 119 | # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid 120 | # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. 121 | typeset -g POWERLEVEL9K_ICON_PADDING=none 122 | 123 | # Basic style options that define the overall look of your prompt. You probably don't want to 124 | # change them. 125 | typeset -g POWERLEVEL9K_BACKGROUND= # transparent background 126 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace 127 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space 128 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol 129 | 130 | # When set to true, icons appear before content on both sides of the prompt. When set 131 | # to false, icons go after content. If empty or not set, icons go before content in the left 132 | # prompt and after content in the right prompt. 133 | # 134 | # You can also override it for a specific segment: 135 | # 136 | # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false 137 | # 138 | # Or for a specific segment in specific state: 139 | # 140 | # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false 141 | typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true 142 | 143 | # Add an empty line before each prompt. 144 | typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true 145 | 146 | # Connect left prompt lines with these symbols. 147 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= 148 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= 149 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= 150 | # Connect right prompt lines with these symbols. 151 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= 152 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= 153 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= 154 | 155 | # The left end of left prompt. 156 | typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= 157 | # The right end of right prompt. 158 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= 159 | 160 | # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll 161 | # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and 162 | # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. 163 | typeset -g POWERLEVEL9K_SHOW_RULER=false 164 | typeset -g POWERLEVEL9K_RULER_CHAR='-' # reasonable alternative: '·' 165 | typeset -g POWERLEVEL9K_RULER_FOREGROUND=242 166 | 167 | # Filler between left and right prompt on the first prompt line. You can set it to '·' or '-' 168 | # to make it easier to see the alignment between left and right prompt and to separate prompt 169 | # from command output. It serves the same purpose as ruler (see above) without increasing 170 | # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false 171 | # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact 172 | # prompt. 173 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' 174 | if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then 175 | # The color of the filler. 176 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 177 | # Add a space between the end of left prompt and the filler. 178 | typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' 179 | # Add a space between the filler and the start of right prompt. 180 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' 181 | # Start filler from the edge of the screen if there are no left segments on the first line. 182 | typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' 183 | # End filler on the edge of the screen if there are no right segments on the first line. 184 | typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' 185 | fi 186 | 187 | #################################[ os_icon: os identifier ]################################## 188 | # OS identifier color. 189 | typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= 190 | # Custom icon. 191 | # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' 192 | 193 | ################################[ prompt_char: prompt symbol ]################################ 194 | # Green prompt symbol if the last command succeeded. 195 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=005 196 | # Red prompt symbol if the last command failed. 197 | typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=005 198 | # Default prompt symbol. 199 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='$' 200 | # Prompt symbol in command vi mode. 201 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='<' 202 | # Prompt symbol in visual vi mode. 203 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' 204 | # Prompt symbol in overwrite vi mode. 205 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='^' 206 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true 207 | # No line terminator if prompt_char is the last segment. 208 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' 209 | # No line introducer if prompt_char is the first segment. 210 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= 211 | 212 | ##################################[ dir: current directory ]################################## 213 | # Default current directory color. 214 | typeset -g POWERLEVEL9K_DIR_FOREGROUND=31 215 | # If directory is too long, shorten some of its segments to the shortest possible unique 216 | # prefix. The shortened directory can be tab-completed to the original. 217 | typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique 218 | # Replace removed segment suffixes with this symbol. 219 | typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= 220 | # Color of the shortened directory segments. 221 | typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103 222 | # Color of the anchor directory segments. Anchor segments are never shortened. The first 223 | # segment is always an anchor. 224 | typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39 225 | # Display anchor directory segments in bold. 226 | typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true 227 | # Don't shorten directories that contain any of these files. They are anchors. 228 | local anchor_files=( 229 | .bzr 230 | .citc 231 | .git 232 | .hg 233 | .node-version 234 | .python-version 235 | .go-version 236 | .ruby-version 237 | .lua-version 238 | .java-version 239 | .perl-version 240 | .php-version 241 | .tool-versions 242 | .shorten_folder_marker 243 | .svn 244 | .terraform 245 | CVS 246 | Cargo.toml 247 | composer.json 248 | go.mod 249 | package.json 250 | stack.yaml 251 | ) 252 | typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" 253 | # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains 254 | # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is 255 | # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) 256 | # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers 257 | # and other directories don't. 258 | # 259 | # Optionally, "first" and "last" can be followed by ":" where is an integer. 260 | # This moves the truncation point to the right (positive offset) or to the left (negative offset) 261 | # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" 262 | # respectively. 263 | typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false 264 | # Don't shorten this many last directory segments. They are anchors. 265 | typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 266 | # Shorten directory if it's longer than this even if there is space for it. The value can 267 | # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, 268 | # directory will be shortened only when prompt doesn't fit or when other parameters demand it 269 | # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). 270 | # If set to `0`, directory will always be shortened to its minimum length. 271 | typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 272 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this 273 | # many columns for typing commands. 274 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 275 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least 276 | # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. 277 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 278 | # If set to true, embed a hyperlink into the directory. Useful for quickly 279 | # opening a directory in the file manager simply by clicking the link. 280 | # Can also be handy when the directory is shortened, as it allows you to see 281 | # the full directory that was used in previous commands. 282 | typeset -g POWERLEVEL9K_DIR_HYPERLINK=false 283 | 284 | # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON 285 | # and POWERLEVEL9K_DIR_CLASSES below. 286 | typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 287 | 288 | # The default icon shown next to non-writable and non-existent directories when 289 | # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. 290 | typeset -g POWERLEVEL9K_LOCK_ICON='∅' 291 | 292 | # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different 293 | # directories. It must be an array with 3 * N elements. Each triplet consists of: 294 | # 295 | # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with 296 | # extended_glob option enabled. 297 | # 2. Directory class for the purpose of styling. 298 | # 3. An empty string. 299 | # 300 | # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. 301 | # 302 | # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories 303 | # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. 304 | # 305 | # For example, given these settings: 306 | # 307 | # typeset -g POWERLEVEL9K_DIR_CLASSES=( 308 | # '~/work(|/*)' WORK '' 309 | # '~(|/*)' HOME '' 310 | # '*' DEFAULT '') 311 | # 312 | # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one 313 | # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or 314 | # WORK_NON_EXISTENT. 315 | # 316 | # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an 317 | # option to define custom colors and icons for different directory classes. 318 | # 319 | # # Styling for WORK. 320 | # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' 321 | # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=31 322 | # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=103 323 | # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=39 324 | # 325 | # # Styling for WORK_NOT_WRITABLE. 326 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' 327 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=31 328 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 329 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 330 | # 331 | # # Styling for WORK_NON_EXISTENT. 332 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' 333 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 334 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 335 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 336 | # 337 | # If a styling parameter isn't explicitly defined for some class, it falls back to the classless 338 | # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls 339 | # back to POWERLEVEL9K_DIR_FOREGROUND. 340 | # 341 | typeset -g POWERLEVEL9K_DIR_CLASSES=() 342 | 343 | # Custom prefix. 344 | # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' 345 | 346 | #####################################[ vcs: git status ]###################################### 347 | # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. 348 | typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= 349 | 350 | # Untracked files icon. It's really a question mark, your font isn't broken. 351 | # Change the value of this parameter to show a different icon. 352 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' 353 | 354 | # Formatter for Git status. 355 | # 356 | # Example output: master wip <42>42 *42 merge ~42 +42 !42 ?42. 357 | # 358 | # You can edit the function to customize how Git status looks. 359 | # 360 | # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: 361 | # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. 362 | function my_git_formatter() { 363 | emulate -L zsh 364 | 365 | if [[ -n $P9K_CONTENT ]]; then 366 | # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from 367 | # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. 368 | typeset -g my_git_format=$P9K_CONTENT 369 | return 370 | fi 371 | 372 | if (( $1 )); then 373 | # Styling for up-to-date Git status. 374 | local meta='%f' # default foreground 375 | local clean='%76F' # green foreground 376 | local modified='%178F' # yellow foreground 377 | local untracked='%39F' # blue foreground 378 | local conflicted='%196F' # red foreground 379 | else 380 | # Styling for incomplete and stale Git status. 381 | local meta='%244F' # grey foreground 382 | local clean='%244F' # grey foreground 383 | local modified='%244F' # grey foreground 384 | local untracked='%244F' # grey foreground 385 | local conflicted='%244F' # grey foreground 386 | fi 387 | 388 | local res="${meta}git:" 389 | 390 | if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then 391 | local branch=${(V)VCS_STATUS_LOCAL_BRANCH} 392 | # If local branch name is at most 32 characters long, show it in full. 393 | # Otherwise show the first 12 .. the last 12. 394 | # Tip: To always show local branch name in full without truncation, delete the next line. 395 | (( $#branch > 32 )) && branch[13,-13]=".." # <-- this line 396 | res+="%004F${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" 397 | fi 398 | 399 | if [[ -n $VCS_STATUS_TAG 400 | # Show tag only if not on a branch. 401 | # Tip: To always show tag, delete the next line. 402 | && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line 403 | ]]; then 404 | local tag=${(V)VCS_STATUS_TAG} 405 | # If tag name is at most 32 characters long, show it in full. 406 | # Otherwise show the first 12 .. the last 12. 407 | # Tip: To always show tag name in full without truncation, delete the next line. 408 | (( $#tag > 32 )) && tag[13,-13]=".." # <-- this line 409 | res+="${meta}#${clean}${tag//\%/%%}" 410 | fi 411 | 412 | # Display "wip" if the latest commit's summary contains "wip" or "WIP". 413 | if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then 414 | res+=" ${modified}wip" 415 | fi 416 | 417 | res+="${meta}(" 418 | 419 | # <42 if behind the remote. 420 | (( VCS_STATUS_COMMITS_BEHIND )) && res+="${clean}<${VCS_STATUS_COMMITS_BEHIND}" 421 | # >42 if ahead of the remote; no leading space if also behind the remote: <42>42. 422 | (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+="" 423 | (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}>${VCS_STATUS_COMMITS_AHEAD}" 424 | # <-42 if behind the push remote. 425 | (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+="${clean}<-${VCS_STATUS_PUSH_COMMITS_BEHIND}" 426 | (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+="" 427 | # ->42 if ahead of the push remote; no leading space if also behind: <-42->42. 428 | (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}->${VCS_STATUS_PUSH_COMMITS_AHEAD}" 429 | # *42 if have stashes. 430 | # (( VCS_STATUS_STASHES )) && res+="${clean}*${VCS_STATUS_STASHES}" 431 | # 'merge' if the repo is in an unusual state. 432 | [[ -n $VCS_STATUS_ACTION ]] && res+="${conflicted}${VCS_STATUS_ACTION}" 433 | # ~42 if have merge conflicts. 434 | (( VCS_STATUS_NUM_CONFLICTED )) && res+="${conflicted}!!${VCS_STATUS_NUM_CONFLICTED}" 435 | # +42 if have staged changes. 436 | (( VCS_STATUS_NUM_STAGED )) && res+="${modified}+${VCS_STATUS_NUM_STAGED}" 437 | # !42 if have unstaged changes. 438 | (( VCS_STATUS_NUM_UNSTAGED )) && res+="${modified}x${VCS_STATUS_NUM_UNSTAGED}" 439 | # ?42 if have untracked files. It's really a question mark, your font isn't broken. 440 | # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. 441 | # Remove the next line if you don't want to see untracked files at all. 442 | (( VCS_STATUS_NUM_UNTRACKED )) && res+="${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" 443 | # "-" if the number of unstaged files is unknown. This can happen due to 444 | # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower 445 | # than the number of files in the Git index, or due to bash.showDirtyState being set to false 446 | # in the repository config. The number of staged and untracked files may also be unknown 447 | # in this case. 448 | (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+="${modified}-" 449 | 450 | (( !VCS_STATUS_COMMITS_BEHIND && !VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND && !VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_NUM_CONFLICTED && !VCS_STATUS_NUM_STAGED && !VCS_STATUS_NUM_UNSTAGED && !VCS_STATUS_NUM_UNTRACKED && !VCS_STATUS_HAS_UNSTAGED )) && res+="${clean}o" 451 | 452 | # Display the current Git commit if there is no branch and no tag. 453 | # Tip: To always display the current Git commit, delete the next line. 454 | # [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line 455 | res+="${meta}) %020F${VCS_STATUS_COMMIT[1,8]}" 456 | 457 | # Show tracking branch name if it differs from local branch. 458 | if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then 459 | res+="${meta}:%020F${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" 460 | fi 461 | 462 | typeset -g my_git_format=$res 463 | } 464 | functions -M my_git_formatter 2>/dev/null 465 | 466 | # Don't count the number of unstaged, untracked and conflicted files in Git repositories with 467 | # more than this many files in the index. Negative value means infinity. 468 | # 469 | # If you are working in Git repositories with tens of millions of files and seeing performance 470 | # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output 471 | # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's 472 | # config: `git config bash.showDirtyState false`. 473 | typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 474 | 475 | # Don't show Git status in prompt for repositories whose workdir matches this pattern. 476 | # For example, if set to '~', the Git repository at $HOME/.git will be ignored. 477 | # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. 478 | typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' 479 | 480 | # Disable the default Git status formatting. 481 | typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true 482 | # Install our own Git status formatter. 483 | typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' 484 | typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' 485 | # Enable counters for staged, unstaged, etc. 486 | typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 487 | 488 | # Icon color. 489 | typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 490 | typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244 491 | # Custom icon. 492 | typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION= 493 | # Custom prefix. 494 | # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' 495 | 496 | # Show status of repositories of these types. You can add svn and/or hg if you are 497 | # using them. If you do, your prompt may become slow even when your current directory 498 | # isn't in an svn or hg reposotiry. 499 | typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) 500 | 501 | # These settings are used for repositories other than Git or when gitstatusd fails and 502 | # Powerlevel10k has to fall back to using vcs_info. 503 | typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 504 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 505 | typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178 506 | 507 | ##########################[ status: exit code of the last command ]########################### 508 | # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and 509 | # style them independently from the regular OK and ERROR state. 510 | typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true 511 | 512 | # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as 513 | # it will signify success by turning green. 514 | typeset -g POWERLEVEL9K_STATUS_OK=false 515 | typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70 516 | typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='ok' 517 | 518 | # Status when some part of a pipe command fails but the overall exit status is zero. It may look 519 | # like this: 1|0. 520 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true 521 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70 522 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='ok' 523 | 524 | # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as 525 | # it will signify error by turning red. 526 | typeset -g POWERLEVEL9K_STATUS_ERROR=true 527 | typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160 528 | typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='err' 529 | 530 | # Status when the last command was terminated by a signal. 531 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true 532 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160 533 | # Use terse signal names: "INT" instead of "SIGINT(2)". 534 | typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=true 535 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION= 536 | 537 | # Status when some part of a pipe command fails and the overall exit status is also non-zero. 538 | # It may look like this: 1|0. 539 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true 540 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160 541 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='err' 542 | 543 | ###################[ command_execution_time: duration of the last command ]################### 544 | # Show duration of the last command if takes at least this many seconds. 545 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=1 546 | # Show this many fractional digits. Zero means round to seconds. 547 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 548 | # Execution time color. 549 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=003 550 | # Duration format: 1d 2h 3m 4s. 551 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' 552 | # Custom icon. 553 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION= 554 | # Custom prefix. 555 | # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' 556 | 557 | #######################[ background_jobs: presence of background jobs ]####################### 558 | # Don't show the number of background jobs. 559 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=true 560 | # Background jobs color. 561 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70 562 | # Custom icon. 563 | # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' 564 | 565 | #######################[ direnv: direnv status (https://direnv.net/) ]######################## 566 | # Direnv color. 567 | typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178 568 | # Custom icon. 569 | # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 570 | 571 | ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### 572 | # Default asdf color. Only used to display tools for which there is no color override (see below). 573 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. 574 | typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 575 | 576 | # There are four parameters that can be used to hide asdf tools. Each parameter describes 577 | # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at 578 | # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to 579 | # hide a tool, it gets shown. 580 | # 581 | # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and 582 | # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: 583 | # 584 | # asdf local python 3.8.1 585 | # asdf global python 3.8.1 586 | # 587 | # After running both commands the current python version is 3.8.1 and its source is "local" as 588 | # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, 589 | # it'll hide python version in this case because 3.8.1 is the same as the global version. 590 | # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't 591 | # contain "local". 592 | 593 | # Hide tool versions that don't come from one of these sources. 594 | # 595 | # Available sources: 596 | # 597 | # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" 598 | # - local `asdf current` says "set by /some/not/home/directory/file" 599 | # - global `asdf current` says "set by /home/username/file" 600 | # 601 | # Note: If this parameter is set to (shell local global), it won't hide tools. 602 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. 603 | typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) 604 | 605 | # If set to false, hide tool versions that are the same as global. 606 | # 607 | # Note: The name of this parameter doesn't reflect its meaning at all. 608 | # Note: If this parameter is set to true, it won't hide tools. 609 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. 610 | typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false 611 | 612 | # If set to false, hide tool versions that are equal to "system". 613 | # 614 | # Note: If this parameter is set to true, it won't hide tools. 615 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. 616 | typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true 617 | 618 | # If set to non-empty value, hide tools unless there is a file matching the specified file pattern 619 | # in the current directory, or its parent directory, or its grandparent directory, and so on. 620 | # 621 | # Note: If this parameter is set to empty value, it won't hide tools. 622 | # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. 623 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. 624 | # 625 | # Example: Hide nodejs version when there is no package.json and no *.js files in the current 626 | # directory, in `..`, in `../..` and so on. 627 | # 628 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' 629 | typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= 630 | 631 | # Ruby version from asdf. 632 | typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 633 | # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' 634 | # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' 635 | 636 | # Python version from asdf. 637 | typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37 638 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' 639 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' 640 | 641 | # Go version from asdf. 642 | typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37 643 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' 644 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' 645 | 646 | # Node.js version from asdf. 647 | typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70 648 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' 649 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' 650 | 651 | # Rust version from asdf. 652 | typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37 653 | # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' 654 | # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' 655 | 656 | # .NET Core version from asdf. 657 | typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 658 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' 659 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_SHOW_ON_UPGLOB='*.foo|*.bar' 660 | 661 | # Flutter version from asdf. 662 | typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 663 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' 664 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' 665 | 666 | # Lua version from asdf. 667 | typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32 668 | # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' 669 | # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' 670 | 671 | # Java version from asdf. 672 | typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32 673 | # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' 674 | # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' 675 | 676 | # Perl version from asdf. 677 | typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 678 | # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' 679 | # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' 680 | 681 | # Erlang version from asdf. 682 | typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125 683 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' 684 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' 685 | 686 | # Elixir version from asdf. 687 | typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129 688 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' 689 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' 690 | 691 | # Postgres version from asdf. 692 | typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31 693 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' 694 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' 695 | 696 | # PHP version from asdf. 697 | typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99 698 | # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' 699 | # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' 700 | 701 | # Haskell version from asdf. 702 | typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172 703 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 704 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' 705 | 706 | # Julia version from asdf. 707 | typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70 708 | # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' 709 | # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' 710 | 711 | ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### 712 | # NordVPN connection indicator color. 713 | typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 714 | # Hide NordVPN connection indicator when not connected. 715 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= 716 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= 717 | # Custom icon. 718 | typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='nord' 719 | 720 | ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### 721 | # Yazi shell color. 722 | typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 723 | # Custom icon. 724 | typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='▲' 725 | 726 | #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## 727 | # Ranger shell color. 728 | typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 729 | # Custom icon. 730 | # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' 731 | 732 | ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### 733 | # Nnn shell color. 734 | typeset -g POWERLEVEL9K_NNN_FOREGROUND=72 735 | # Custom icon. 736 | # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' 737 | 738 | ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## 739 | # xplr shell color. 740 | typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 741 | # Custom icon. 742 | # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' 743 | 744 | ###########################[ vim_shell: vim shell indicator (:sh) ]########################### 745 | # Vim shell indicator color. 746 | typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 747 | # Custom icon. 748 | # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 749 | 750 | ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### 751 | # Midnight Commander shell color. 752 | typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178 753 | # Custom icon. 754 | # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' 755 | 756 | #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## 757 | # Nix shell color. 758 | typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 759 | 760 | # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. 761 | # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= 762 | 763 | # Custom icon. 764 | # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 765 | 766 | ##################################[ disk_usage: disk usage ]################################## 767 | # Colors for different levels of disk usage. 768 | typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 769 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=220 770 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=160 771 | # Thresholds for different levels of disk usage (percentage points). 772 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 773 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 774 | # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. 775 | typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false 776 | # Custom icon. 777 | # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' 778 | 779 | ######################################[ ram: free RAM ]####################################### 780 | # RAM color. 781 | typeset -g POWERLEVEL9K_RAM_FOREGROUND=66 782 | # Custom icon. 783 | # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' 784 | 785 | #####################################[ swap: used swap ]###################################### 786 | # Swap color. 787 | typeset -g POWERLEVEL9K_SWAP_FOREGROUND=96 788 | # Custom icon. 789 | # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' 790 | 791 | ######################################[ load: CPU load ]###################################### 792 | # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. 793 | typeset -g POWERLEVEL9K_LOAD_WHICH=1 794 | # Load color when load is under 50%. 795 | typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66 796 | # Load color when load is between 50% and 70%. 797 | typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178 798 | # Load color when load is over 70%. 799 | typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166 800 | # Custom icon. 801 | # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='cpu' 802 | 803 | ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ 804 | # Todo color. 805 | typeset -g POWERLEVEL9K_TODO_FOREGROUND=110 806 | # Hide todo when the total number of tasks is zero. 807 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true 808 | # Hide todo when the number of tasks after filtering is zero. 809 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false 810 | 811 | # Todo format. The following parameters are available within the expansion. 812 | # 813 | # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. 814 | # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. 815 | # 816 | # These variables correspond to the last line of the output of `todo.sh -p ls`: 817 | # 818 | # TODO: 24 of 42 tasks shown 819 | # 820 | # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. 821 | # 822 | # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' 823 | 824 | # Custom icon. 825 | # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' 826 | 827 | ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ 828 | # Timewarrior color. 829 | typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=110 830 | # If the tracked task is longer than 24 characters, truncate and append "..". 831 | # Tip: To always display tasks without truncation, delete the following parameter. 832 | # Tip: To hide task names and display just the icon when time tracking is enabled, set the 833 | # value of the following parameter to "". 834 | typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+..}' 835 | 836 | # Custom icon. 837 | # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' 838 | 839 | ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## 840 | # Taskwarrior color. 841 | typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74 842 | 843 | # Taskwarrior segment format. The following parameters are available within the expansion. 844 | # 845 | # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. 846 | # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. 847 | # 848 | # Zero values are represented as empty parameters. 849 | # 850 | # The default format: 851 | # 852 | # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' 853 | # 854 | # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' 855 | 856 | # Custom icon. 857 | # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' 858 | 859 | ##################################[ context: user@hostname ]################################## 860 | # Context color when running with privileges. 861 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178 862 | # Context color in SSH without privileges. 863 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180 864 | # Default context color (no privileges, no SSH). 865 | typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=046 866 | 867 | # Context format when running with privileges: bold user@hostname. 868 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n @ %m' 869 | # Context format when in SSH without privileges: user@hostname. 870 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n @ %m' 871 | # Default context format (no privileges, no SSH): user@hostname. 872 | typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n @ %m' 873 | 874 | # Don't show context unless running with privileges or in SSH. 875 | # Tip: Remove the next line to always show context. 876 | # typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= 877 | 878 | # Custom icon. 879 | # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' 880 | # Custom prefix. 881 | # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%f ' 882 | 883 | ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### 884 | # Python virtual environment color. 885 | typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 886 | # Don't show Python version next to the virtual environment name. 887 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=true 888 | # If set to "false", won't show virtualenv if pyenv is already shown. 889 | # If set to "if-different", won't show virtualenv if it's the same as pyenv. 890 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=true 891 | # Separate environment name from Python version only with a space. 892 | typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= 893 | # Custom icon. 894 | # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 895 | 896 | #####################[ anaconda: conda environment (https://conda.io/) ]###################### 897 | # Anaconda environment color. 898 | typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37 899 | 900 | # Anaconda segment format. The following parameters are available within the expansion. 901 | # 902 | # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. 903 | # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. 904 | # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). 905 | # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). 906 | # 907 | # CONDA_PROMPT_MODIFIER can be configured with the following command: 908 | # 909 | # conda config --set env_prompt '({default_env}) ' 910 | # 911 | # The last argument is a Python format string that can use the following variables: 912 | # 913 | # - prefix The same as CONDA_PREFIX. 914 | # - default_env The same as CONDA_DEFAULT_ENV. 915 | # - name The last segment of CONDA_PREFIX. 916 | # - stacked_env Comma-separated list of names in the environment stack. The first element is 917 | # always the same as default_env. 918 | # 919 | # Note: '({default_env}) ' is the default value of env_prompt. 920 | # 921 | # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER 922 | # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former 923 | # is empty. 924 | typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' 925 | 926 | # Custom icon. 927 | # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' 928 | 929 | ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ 930 | # Pyenv color. 931 | typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37 932 | # Hide python version if it doesn't come from one of these sources. 933 | typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) 934 | # If set to false, hide python version if it's the same as global: 935 | # $(pyenv version-name) == $(pyenv global). 936 | typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false 937 | # If set to false, hide python version if it's equal to "system". 938 | typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true 939 | 940 | # Pyenv segment format. The following parameters are available within the expansion. 941 | # 942 | # - P9K_CONTENT Current pyenv environment (pyenv version-name). 943 | # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). 944 | # 945 | # The default format has the following logic: 946 | # 947 | # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or 948 | # starts with "$P9K_PYENV_PYTHON_VERSION/". 949 | # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". 950 | typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' 951 | 952 | # Custom icon. 953 | # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 954 | 955 | ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ 956 | # Goenv color. 957 | typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37 958 | # Hide go version if it doesn't come from one of these sources. 959 | typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) 960 | # If set to false, hide go version if it's the same as global: 961 | # $(goenv version-name) == $(goenv global). 962 | typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false 963 | # If set to false, hide go version if it's equal to "system". 964 | typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true 965 | # Custom icon. 966 | # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 967 | 968 | ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## 969 | # Nodenv color. 970 | typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70 971 | # Hide node version if it doesn't come from one of these sources. 972 | typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) 973 | # If set to false, hide node version if it's the same as global: 974 | # $(nodenv version-name) == $(nodenv global). 975 | typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false 976 | # If set to false, hide node version if it's equal to "system". 977 | typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true 978 | # Custom icon. 979 | # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 980 | 981 | ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### 982 | # Nvm color. 983 | typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 984 | # Custom icon. 985 | # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 986 | 987 | ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ 988 | # Nodeenv color. 989 | typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70 990 | # Don't show Node version next to the environment name. 991 | typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false 992 | # Separate environment name from Node version only with a space. 993 | typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= 994 | # Custom icon. 995 | # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 996 | 997 | ##############################[ node_version: node.js version ]############################### 998 | # Node version color. 999 | typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70 1000 | # Show node version only when in a directory tree containing package.json. 1001 | typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true 1002 | # Custom icon. 1003 | typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⬢' 1004 | 1005 | #######################[ go_version: go version (https://golang.org) ]######################## 1006 | # Go version color. 1007 | typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37 1008 | # Show go version only when in a go project subdirectory. 1009 | typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true 1010 | # Custom icon. 1011 | # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1012 | 1013 | #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## 1014 | # Rust version color. 1015 | typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37 1016 | # Show rust version only when in a rust project subdirectory. 1017 | typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true 1018 | # Custom icon. 1019 | # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1020 | 1021 | ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ 1022 | # .NET version color. 1023 | typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134 1024 | # Show .NET version only when in a .NET project subdirectory. 1025 | typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true 1026 | # Custom icon. 1027 | # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1028 | 1029 | #####################[ php_version: php version (https://www.php.net/) ]###################### 1030 | # PHP version color. 1031 | typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99 1032 | # Show PHP version only when in a PHP project subdirectory. 1033 | typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true 1034 | # Custom icon. 1035 | # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1036 | 1037 | ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### 1038 | # Laravel version color. 1039 | typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161 1040 | # Custom icon. 1041 | # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1042 | 1043 | ####################[ java_version: java version (https://www.java.com/) ]#################### 1044 | # Java version color. 1045 | typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32 1046 | # Show java version only when in a java project subdirectory. 1047 | typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true 1048 | # Show brief version. 1049 | typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false 1050 | # Custom icon. 1051 | # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1052 | 1053 | ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### 1054 | # Package color. 1055 | typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117 1056 | # Package format. The following parameters are available within the expansion. 1057 | # 1058 | # - P9K_PACKAGE_NAME The value of `name` field in package.json. 1059 | # - P9K_PACKAGE_VERSION The value of `version` field in package.json. 1060 | # 1061 | # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' 1062 | # Custom icon. 1063 | # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1064 | 1065 | #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## 1066 | # Rbenv color. 1067 | typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168 1068 | # Hide ruby version if it doesn't come from one of these sources. 1069 | typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) 1070 | # If set to false, hide ruby version if it's the same as global: 1071 | # $(rbenv version-name) == $(rbenv global). 1072 | typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false 1073 | # If set to false, hide ruby version if it's equal to "system". 1074 | typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true 1075 | # Custom icon. 1076 | # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1077 | 1078 | #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## 1079 | # Rvm color. 1080 | typeset -g POWERLEVEL9K_RVM_FOREGROUND=168 1081 | # Don't show @gemset at the end. 1082 | typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false 1083 | # Don't show ruby- at the front. 1084 | typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false 1085 | # Custom icon. 1086 | # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 1087 | 1088 | ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ 1089 | # Fvm color. 1090 | typeset -g POWERLEVEL9K_FVM_FOREGROUND=38 1091 | # Custom icon. 1092 | # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 1093 | 1094 | ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### 1095 | # Lua color. 1096 | typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32 1097 | # Hide lua version if it doesn't come from one of these sources. 1098 | typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) 1099 | # If set to false, hide lua version if it's the same as global: 1100 | # $(luaenv version-name) == $(luaenv global). 1101 | typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false 1102 | # If set to false, hide lua version if it's equal to "system". 1103 | typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true 1104 | # Custom icon. 1105 | # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1106 | 1107 | ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ 1108 | # Java color. 1109 | typeset -g POWERLEVEL9K_JENV_FOREGROUND=32 1110 | # Hide java version if it doesn't come from one of these sources. 1111 | typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) 1112 | # If set to false, hide java version if it's the same as global: 1113 | # $(jenv version-name) == $(jenv global). 1114 | typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false 1115 | # If set to false, hide java version if it's equal to "system". 1116 | typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true 1117 | # Custom icon. 1118 | # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1119 | 1120 | ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ 1121 | # Perl color. 1122 | typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67 1123 | # Hide perl version if it doesn't come from one of these sources. 1124 | typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) 1125 | # If set to false, hide perl version if it's the same as global: 1126 | # $(plenv version-name) == $(plenv global). 1127 | typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false 1128 | # If set to false, hide perl version if it's equal to "system". 1129 | typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true 1130 | # Custom icon. 1131 | # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1132 | 1133 | ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ 1134 | # PHP color. 1135 | typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 1136 | # Hide php version if it doesn't come from one of these sources. 1137 | typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) 1138 | # If set to false, hide php version if it's the same as global: 1139 | # $(phpenv version-name) == $(phpenv global). 1140 | typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false 1141 | # If set to false, hide php version if it's equal to "system". 1142 | typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true 1143 | # Custom icon. 1144 | # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1145 | 1146 | #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### 1147 | # Scala color. 1148 | typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 1149 | # Hide scala version if it doesn't come from one of these sources. 1150 | typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) 1151 | # If set to false, hide scala version if it's the same as global: 1152 | # $(scalaenv version-name) == $(scalaenv global). 1153 | typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false 1154 | # If set to false, hide scala version if it's equal to "system". 1155 | typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true 1156 | # Custom icon. 1157 | # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1158 | 1159 | ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### 1160 | # Haskell color. 1161 | typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 1162 | # Hide haskell version if it doesn't come from one of these sources. 1163 | # 1164 | # shell: version is set by STACK_YAML 1165 | # local: version is set by stack.yaml up the directory tree 1166 | # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) 1167 | typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) 1168 | # If set to false, hide haskell version if it's the same as in the implicit global project. 1169 | typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true 1170 | # Custom icon. 1171 | # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' 1172 | 1173 | #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# 1174 | # Show kubecontext only when the the command you are typing invokes one of these tools. 1175 | # Tip: Remove the next line to always show kubecontext. 1176 | typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' 1177 | 1178 | # Kubernetes context classes for the purpose of using different colors, icons and expansions with 1179 | # different contexts. 1180 | # 1181 | # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element 1182 | # in each pair defines a pattern against which the current kubernetes context gets matched. 1183 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1184 | # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, 1185 | # you'll see this value in your prompt. The second element of each pair in 1186 | # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The 1187 | # first match wins. 1188 | # 1189 | # For example, given these settings: 1190 | # 1191 | # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( 1192 | # '*prod*' PROD 1193 | # '*test*' TEST 1194 | # '*' DEFAULT) 1195 | # 1196 | # If your current kubernetes context is "deathray-testing/default", its class is TEST 1197 | # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. 1198 | # 1199 | # You can define different colors, icons and content expansions for different classes: 1200 | # 1201 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=28 1202 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1203 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1204 | typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( 1205 | # '*prod*' PROD # These values are examples that are unlikely 1206 | # '*test*' TEST # to match your needs. Customize them as needed. 1207 | '*' DEFAULT) 1208 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134 1209 | # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1210 | 1211 | # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext 1212 | # segment. Parameter expansions are very flexible and fast, too. See reference: 1213 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. 1214 | # 1215 | # Within the expansion the following parameters are always available: 1216 | # 1217 | # - P9K_CONTENT The content that would've been displayed if there was no content 1218 | # expansion defined. 1219 | # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the 1220 | # output of `kubectl config get-contexts`. 1221 | # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the 1222 | # output of `kubectl config get-contexts`. 1223 | # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE 1224 | # in the output of `kubectl config get-contexts`. If there is no 1225 | # namespace, the parameter is set to "default". 1226 | # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the 1227 | # output of `kubectl config get-contexts`. 1228 | # 1229 | # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), 1230 | # the following extra parameters are available: 1231 | # 1232 | # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". 1233 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. 1234 | # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. 1235 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. 1236 | # 1237 | # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, 1238 | # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": 1239 | # 1240 | # - P9K_KUBECONTEXT_CLOUD_NAME=gke 1241 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account 1242 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a 1243 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 1244 | # 1245 | # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": 1246 | # 1247 | # - P9K_KUBECONTEXT_CLOUD_NAME=eks 1248 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 1249 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 1250 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 1251 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= 1252 | # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. 1253 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' 1254 | # Append the current context's namespace if it's not "default". 1255 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' 1256 | 1257 | # Custom prefix. 1258 | # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' 1259 | 1260 | ################[ terraform: terraform workspace (https://www.terraform.io) ]################# 1261 | # Don't show terraform workspace if it's literally "default". 1262 | typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false 1263 | # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element 1264 | # in each pair defines a pattern against which the current terraform workspace gets matched. 1265 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1266 | # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, 1267 | # you'll see this value in your prompt. The second element of each pair in 1268 | # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The 1269 | # first match wins. 1270 | # 1271 | # For example, given these settings: 1272 | # 1273 | # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( 1274 | # '*prod*' PROD 1275 | # '*test*' TEST 1276 | # '*' OTHER) 1277 | # 1278 | # If your current terraform workspace is "project_test", its class is TEST because "project_test" 1279 | # doesn't match the pattern '*prod*' but does match '*test*'. 1280 | # 1281 | # You can define different colors, icons and content expansions for different classes: 1282 | # 1283 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28 1284 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1285 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1286 | typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( 1287 | # '*prod*' PROD # These values are examples that are unlikely 1288 | # '*test*' TEST # to match your needs. Customize them as needed. 1289 | '*' OTHER) 1290 | typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 1291 | # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' 1292 | 1293 | #############[ terraform_version: terraform version (https://www.terraform.io) ]############## 1294 | # Terraform version color. 1295 | typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 1296 | # Custom icon. 1297 | # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1298 | 1299 | #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# 1300 | # Show aws only when the the command you are typing invokes one of these tools. 1301 | # Tip: Remove the next line to always show aws. 1302 | typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' 1303 | 1304 | # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element 1305 | # in each pair defines a pattern against which the current AWS profile gets matched. 1306 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1307 | # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, 1308 | # you'll see this value in your prompt. The second element of each pair in 1309 | # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The 1310 | # first match wins. 1311 | # 1312 | # For example, given these settings: 1313 | # 1314 | # typeset -g POWERLEVEL9K_AWS_CLASSES=( 1315 | # '*prod*' PROD 1316 | # '*test*' TEST 1317 | # '*' DEFAULT) 1318 | # 1319 | # If your current AWS profile is "company_test", its class is TEST 1320 | # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. 1321 | # 1322 | # You can define different colors, icons and content expansions for different classes: 1323 | # 1324 | # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 1325 | # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1326 | # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1327 | typeset -g POWERLEVEL9K_AWS_CLASSES=( 1328 | # '*prod*' PROD # These values are examples that are unlikely 1329 | # '*test*' TEST # to match your needs. Customize them as needed. 1330 | '*' DEFAULT) 1331 | typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208 1332 | # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1333 | 1334 | # AWS segment format. The following parameters are available within the expansion. 1335 | # 1336 | # - P9K_AWS_PROFILE The name of the current AWS profile. 1337 | # - P9K_AWS_REGION The region associated with the current AWS profile. 1338 | typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' 1339 | 1340 | #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# 1341 | # AWS Elastic Beanstalk environment color. 1342 | typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 1343 | # Custom icon. 1344 | # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1345 | 1346 | ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## 1347 | # Show azure only when the the command you are typing invokes one of these tools. 1348 | # Tip: Remove the next line to always show azure. 1349 | typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' 1350 | # Azure account name color. 1351 | typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 1352 | # Custom icon. 1353 | # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1354 | 1355 | ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### 1356 | # Show gcloud only when the the command you are typing invokes one of these tools. 1357 | # Tip: Remove the next line to always show gcloud. 1358 | typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' 1359 | # Google cloud color. 1360 | typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32 1361 | 1362 | # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or 1363 | # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative 1364 | # enough. You can use the following parameters in the expansions. Each of them corresponds to the 1365 | # output of `gcloud` tool. 1366 | # 1367 | # Parameter | Source 1368 | # -------------------------|-------------------------------------------------------------------- 1369 | # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' 1370 | # P9K_GCLOUD_ACCOUNT | gcloud config get-value account 1371 | # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project 1372 | # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' 1373 | # 1374 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. 1375 | # 1376 | # Obtaining project name requires sending a request to Google servers. This can take a long time 1377 | # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud 1378 | # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets 1379 | # set and gcloud prompt segment transitions to state COMPLETE. 1380 | # 1381 | # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL 1382 | # and COMPLETE. You can also hide gcloud in state PARTIAL by setting 1383 | # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and 1384 | # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. 1385 | typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' 1386 | typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' 1387 | 1388 | # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name 1389 | # this often. Negative value disables periodic polling. In this mode project name is retrieved 1390 | # only when the current configuration, account or project id changes. 1391 | typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 1392 | 1393 | # Custom icon. 1394 | # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' 1395 | 1396 | #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# 1397 | # Show google_app_cred only when the the command you are typing invokes one of these tools. 1398 | # Tip: Remove the next line to always show google_app_cred. 1399 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' 1400 | 1401 | # Google application credentials classes for the purpose of using different colors, icons and 1402 | # expansions with different credentials. 1403 | # 1404 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first 1405 | # element in each pair defines a pattern against which the current kubernetes context gets 1406 | # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion 1407 | # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION 1408 | # parameters, you'll see this value in your prompt. The second element of each pair in 1409 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. 1410 | # The first match wins. 1411 | # 1412 | # For example, given these settings: 1413 | # 1414 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( 1415 | # '*:*prod*:*' PROD 1416 | # '*:*test*:*' TEST 1417 | # '*' DEFAULT) 1418 | # 1419 | # If your current Google application credentials is "service_account deathray-testing x@y.com", 1420 | # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. 1421 | # 1422 | # You can define different colors, icons and content expansions for different classes: 1423 | # 1424 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 1425 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1426 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' 1427 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( 1428 | # '*:*prod*:*' PROD # These values are examples that are unlikely 1429 | # '*:*test*:*' TEST # to match your needs. Customize them as needed. 1430 | '*' DEFAULT) 1431 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=32 1432 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1433 | 1434 | # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by 1435 | # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: 1436 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. 1437 | # 1438 | # You can use the following parameters in the expansion. Each of them corresponds to one of the 1439 | # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. 1440 | # 1441 | # Parameter | JSON key file field 1442 | # ---------------------------------+--------------- 1443 | # P9K_GOOGLE_APP_CRED_TYPE | type 1444 | # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id 1445 | # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email 1446 | # 1447 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. 1448 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' 1449 | 1450 | ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### 1451 | # Toolbox color. 1452 | typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178 1453 | # Don't display the name of the toolbox if it matches fedora-toolbox-*. 1454 | typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' 1455 | # Custom icon. 1456 | # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' 1457 | # Custom prefix. 1458 | # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' 1459 | 1460 | ###############################[ public_ip: public IP address ]############################### 1461 | # Public IP color. 1462 | typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94 1463 | typeset -g POWERLEVEL9K_SUKKA_CUSTOM_IP_FOREGROUND=94 1464 | # Custom icon. 1465 | # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1466 | 1467 | ########################[ vpn_ip: virtual private network indicator ]######################### 1468 | # VPN IP color. 1469 | typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=81 1470 | # When on VPN, show just an icon without the IP address. 1471 | # Tip: To display the private IP address when on VPN, remove the next line. 1472 | typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= 1473 | # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN 1474 | # to see the name of the interface. 1475 | typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' 1476 | # If set to true, show one segment per matching network interface. If set to false, show only 1477 | # one segment corresponding to the first matching network interface. 1478 | # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. 1479 | typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false 1480 | # Custom icon. 1481 | # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1482 | 1483 | ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### 1484 | # IP color. 1485 | typeset -g POWERLEVEL9K_IP_FOREGROUND=38 1486 | # The following parameters are accessible within the expansion: 1487 | # 1488 | # Parameter | Meaning 1489 | # ----------------------+------------------------------------------- 1490 | # P9K_IP_IP | IP address 1491 | # P9K_IP_INTERFACE | network interface 1492 | # P9K_IP_RX_BYTES | total number of bytes received 1493 | # P9K_IP_TX_BYTES | total number of bytes sent 1494 | # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt 1495 | # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt 1496 | # P9K_IP_RX_RATE | receive rate (since last prompt) 1497 | # P9K_IP_TX_RATE | send rate (since last prompt) 1498 | typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F<$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F>$P9K_IP_TX_RATE}' 1499 | # Show information for the first network interface whose name matches this regular expression. 1500 | # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. 1501 | typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' 1502 | # Custom icon. 1503 | # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1504 | 1505 | #########################[ proxy: system-wide http/https/ftp proxy ]########################## 1506 | # Proxy color. 1507 | typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68 1508 | # Custom icon. 1509 | typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='proxy' 1510 | 1511 | ################################[ battery: internal battery ]################################# 1512 | # Show battery in red when it's below this level and not connected to power supply. 1513 | typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 1514 | typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160 1515 | # Show battery in green when it's charging or fully charged. 1516 | typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=70 1517 | # Show battery in yellow when it's discharging. 1518 | typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178 1519 | # Battery pictograms going from low to high level of charge. 1520 | typeset -g POWERLEVEL9K_BATTERY_STAGES=('battery') 1521 | # Don't show the remaining time to charge/discharge. 1522 | typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false 1523 | 1524 | #####################################[ wifi: wifi speed ]##################################### 1525 | # WiFi color. 1526 | typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68 1527 | # Custom icon. 1528 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' 1529 | 1530 | # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). 1531 | # 1532 | # # Wifi colors and icons for different signal strength levels (low to high). 1533 | # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values 1534 | # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values 1535 | # 1536 | # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' 1537 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' 1538 | # 1539 | # The following parameters are accessible within the expansions: 1540 | # 1541 | # Parameter | Meaning 1542 | # ----------------------+--------------- 1543 | # P9K_WIFI_SSID | service set identifier, a.k.a. network name 1544 | # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown 1545 | # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second 1546 | # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 1547 | # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 1548 | # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) 1549 | 1550 | ####################################[ time: current time ]#################################### 1551 | # Current time color. 1552 | typeset -g POWERLEVEL9K_TIME_FOREGROUND=004 1553 | # Format for the current time: 09:51:02. See `man 3 strftime`. 1554 | typeset -g POWERLEVEL9K_TIME_FORMAT='[%D{%H:%M:%S}]' 1555 | # If set to true, time will update when you hit enter. This way prompts for the past 1556 | # commands will contain the start times of their commands as opposed to the default 1557 | # behavior where they contain the end times of their preceding commands. 1558 | typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false 1559 | # Custom icon. 1560 | typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION= 1561 | # Custom prefix. 1562 | # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' 1563 | 1564 | # Example of a user-defined prompt segment. Function prompt_example will be called on every 1565 | # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or 1566 | # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user. 1567 | # 1568 | # Type `p10k help segment` for documentation and a more sophisticated example. 1569 | 1570 | # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job 1571 | # is to generate the prompt segment for display in instant prompt. See 1572 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. 1573 | # 1574 | # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function 1575 | # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k 1576 | # will replay these calls without actually calling instant_prompt_*. It is imperative that 1577 | # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this 1578 | # rule is not observed, the content of instant prompt will be incorrect. 1579 | # 1580 | # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If 1581 | # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. 1582 | function instant_prompt_example() { 1583 | # Since prompt_example always makes the same `p10k segment` calls, we can call it from 1584 | # instant_prompt_example. This will give us the same `example` prompt segment in the instant 1585 | # and regular prompts. 1586 | prompt_example 1587 | } 1588 | 1589 | # User-defined prompt segments can be customized the same way as built-in segments. 1590 | # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 1591 | # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1592 | 1593 | # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt 1594 | # when accepting a command line. Supported values: 1595 | # 1596 | # - off: Don't change prompt when accepting a command line. 1597 | # - always: Trim down prompt when accepting a command line. 1598 | # - same-dir: Trim down prompt when accepting a command line unless this is the first command 1599 | # typed after changing current working directory. 1600 | typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always 1601 | 1602 | # Instant prompt mode. 1603 | # 1604 | # - off: Disable instant prompt. Choose this if you've tried instant prompt and found 1605 | # it incompatible with your zsh configuration files. 1606 | # - quiet: Enable instant prompt and don't print warnings when detecting console output 1607 | # during zsh initialization. Choose this if you've read and understood 1608 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. 1609 | # - verbose: Enable instant prompt and print a warning when detecting console output during 1610 | # zsh initialization. Choose this if you've never tried instant prompt, haven't 1611 | # seen the warning, or if you are unsure what this all means. 1612 | typeset -g POWERLEVEL9K_INSTANT_PROMPT=off 1613 | 1614 | # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. 1615 | # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload 1616 | # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you 1617 | # really need it. 1618 | typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true 1619 | 1620 | # If p10k is already loaded, reload configuration. 1621 | # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. 1622 | (( ! $+functions[p10k] )) || p10k reload 1623 | } 1624 | 1625 | # Tell `p10k configure` which file it should overwrite. 1626 | typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} 1627 | 1628 | (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} 1629 | 'builtin' 'unset' 'p10k_config_opts' 1630 | -------------------------------------------------------------------------------- /dot_zshrc: -------------------------------------------------------------------------------- 1 | # =================================================== # 2 | # _____ _ _ ______ # 3 | # / ____| | | | | | ____| # 4 | # | (___ _ _| | _| | ____ _ | |__ ______ __ # 5 | # \___ \| | | | |/ / |/ / _\`| | __| | _ \ \ / / # 6 | # ____) | |_| | <| < (_| | | |____| | | \ V / # 7 | # |_____/ \__,_|_|\_\_|\_\__,_| |______|_| |_|\_/ # 8 | # # 9 | # =================================================== # 10 | 11 | # For Performance Debug purpose 12 | # Set to 1 to enable profiling 13 | SUKKA_ENABLE_PERFORMANCE_PROFILING=0 14 | 15 | if (( $SUKKA_ENABLE_PERFORMANCE_PROFILING )); then 16 | rm -rf zsh_profile* 17 | zmodload zsh/zprof 18 | 19 | zmodload zsh/datetime 20 | 21 | setopt PROMPT_SUBST 22 | PS4='+$EPOCHREALTIME %N:%i> ' 23 | __sukka_zsh_profiling_logfile=$(mktemp zsh_profile.XXXXXX) 24 | echo "Logging to $__sukka_zsh_profiling_logfile" 25 | exec 3>&2 2>$__sukka_zsh_profiling_logfile 26 | 27 | setopt XTRACE 28 | fi 29 | 30 | # Path to your oh-my-zsh installation. 31 | export ZSH="$HOME/.oh-my-zsh" 32 | 33 | # Set name of the theme to load --- if set to "random", it will 34 | # load a random theme each time oh-my-zsh is loaded, in which case, 35 | # to know which specific one was loaded, run: echo $RANDOM_THEME 36 | # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes 37 | 38 | #ZSH_THEME="sukka" 39 | ZSH_THEME="powerlevel10k/powerlevel10k" 40 | 41 | # Uncomment the following line to use case-sensitive completion. 42 | # CASE_SENSITIVE="true" 43 | 44 | # Uncomment the following line to use hyphen-insensitive completion. 45 | # Case-sensitive completion must be off. _ and - will be interchangeable. 46 | # HYPHEN_INSENSITIVE="true" 47 | 48 | # Uncomment the following line to disable bi-weekly auto-update checks. 49 | # DISABLE_AUTO_UPDATE="true" 50 | 51 | # Uncomment the following line to change how often to auto-update (in days). 52 | export UPDATE_ZSH_DAYS=30 53 | 54 | # Uncomment the following line to disable colors in ls. 55 | # DISABLE_LS_COLORS="true" 56 | 57 | # Uncomment the following line to disable auto-setting terminal title. 58 | # DISABLE_AUTO_TITLE="true" 59 | 60 | # Uncomment the following line to enable command auto-correction. 61 | # ENABLE_CORRECTION="true" 62 | 63 | # Uncomment the following line to display red dots whilst waiting for completion. 64 | COMPLETION_WAITING_DOTS="true" 65 | 66 | # Uncomment the following line if you want to disable marking untracked files 67 | # under VCS as dirty. This makes repository status check for large repositories 68 | # much, much faster. 69 | DISABLE_UNTRACKED_FILES_DIRTY="true" 70 | 71 | # Uncomment the following line if you want to change the command execution time 72 | # stamp shown in the history command output. 73 | # You can set one of the optional three formats: 74 | # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 75 | # or set a custom format using the strftime function format specifications, 76 | # see 'man strftime' for details. 77 | HIST_STAMPS="yyyy-mm-dd" 78 | 79 | # Enable insecure directories and files from custom plugins 80 | # ZSH_DISABLE_COMPFIX="true" 81 | 82 | # Would you like to use another custom folder than $ZSH/custom? 83 | # ZSH_CUSTOM=/path/to/new-custom-folder 84 | 85 | # Cache Freq Use Variables 86 | ## Result of uname -sm 87 | __SUKKA_UNAME_SM=$(uname -sm) 88 | ## Is currently on macOS 89 | __SUKKA_IS_DARWIN=$OSTYPE[(I)darwin] 90 | __SUKKA_IS_LINUX=$OSTYPE[(I)linux-gnu] 91 | ## Is currently on macOS M chip 92 | local __sukka_darwin_64_str="Darwin arm64" 93 | __SUKKA_IS_DARWIN_ARM64=$__SUKKA_UNAME_SM[(I)$__sukka_darwin_64_str] 94 | ## Homebrew prefix 95 | (( $__SUKKA_IS_DARWIN_ARM64 )) && __SUKKA_HOMEBREW__PREFIX="/opt/homebrew" || __SUKKA_HOMEBREW__PREFIX="/usr/local" 96 | ## pyenv prefix 97 | __SUKKA_HOMEBREW_PYENV_PREFIX="${__SUKKA_HOMEBREW__PREFIX}/opt/pyenv" 98 | ## Box Name used for my zsh-theme 99 | # __SUKKA_BOX_NAME=${HOST/.local/} 100 | # Homebrew zsh completion path 101 | __SUKKA_HOMEBREW_ZSH_COMPLETION="${__SUKKA_HOMEBREW__PREFIX}/share/zsh/site-functions" 102 | # zsh-completion fpath 103 | # git clone https://github.com/zsh-users/zsh-completions $ZSH/custom/plugins/zsh-completions/ 104 | __SUKKA_ZSH_COMPLETION_SRC="${ZSH}/custom/plugins/zsh-completions/src" 105 | 106 | # This speed up zsh-autosuggetions by a lot 107 | export ZSH_AUTOSUGGEST_USE_ASYNC="true" 108 | 109 | # Which plugins would you like to load? 110 | # Standard plugins can be found in ~/.oh-my-zsh/plugins/* 111 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 112 | # Example format: plugins=(rails git textmate ruby lighthouse) 113 | # Add wisely, as too many plugins slow down shell startup. 114 | 115 | plugins=( 116 | # osx 117 | zsh-autosuggestions 118 | # git 119 | # zsh-syntax-highlighting 120 | # fast-syntax-highlighting 121 | F-Sy-H 122 | zsh-gitcd 123 | # zsh-completion will be added to FPATH directly 124 | # zsh-completions 125 | zsh-z 126 | # zsh-interactive-cd 127 | fzf-tab 128 | ) 129 | 130 | # ZSH completions 131 | ## For homebrew, is must be added before oh-my-zsh is called. 132 | ## https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh 133 | ## https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/github/README.md#homebrew-installation-note 134 | ## Add a check avoiding duplicated fpath 135 | if [[ -d ${__SUKKA_HOMEBREW_ZSH_COMPLETION} ]] && (( ! $FPATH[(I)${__SUKKA_HOMEBREW_ZSH_COMPLETION}] )); then 136 | FPATH=${__SUKKA_HOMEBREW_ZSH_COMPLETION}:$FPATH 137 | fi 138 | ## https://github.com/zsh-users/zsh-completions 139 | if [[ -d ${__SUKKA_ZSH_COMPLETION_SRC} ]] && (( ! $FPATH[(I)${__SUKKA_ZSH_COMPLETION_SRC}] )); then 140 | FPATH="${__SUKKA_ZSH_COMPLETION_SRC}:$FPATH" 141 | fi 142 | 143 | # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. 144 | [[ ! -f $HOME/.p10k.zsh ]] || source $HOME/.p10k.zsh 145 | 146 | source $ZSH/oh-my-zsh.sh 147 | 148 | # User configuration 149 | 150 | # export MANPATH="/usr/local/man:$MANPATH" 151 | 152 | # You may need to manually set your language environment 153 | export LANG=en_US.UTF-8 154 | 155 | # Preferred editor for local and remote sessions 156 | if (( $#SSH_CONNECTION )); then 157 | export EDITOR='vim' 158 | else 159 | export EDITOR='nano' 160 | fi 161 | 162 | # Compilation flags 163 | # export ARCHFLAGS="-arch x86_64" 164 | 165 | # ssh 166 | # export SSH_KEY_PATH="~/.ssh/rsa_id" 167 | 168 | # Set NPM Global Path 169 | export NPM_CONFIG_PREFIX="$HOME/.npm-global" 170 | [[ ! -d "$NPM_CONFIG_PREFIX" ]] && mkdir -p $NPM_CONFIG_PREFIX 171 | 172 | # pnpm add -g fails with corepack · Issue #434 · nodejs/corepack 173 | if (( $+XDG_DATA_HOME )) then 174 | # XDG_HOME is set 175 | export PNPM_HOME="$XDG_DATA_HOME/pnpm/store" 176 | elif (( $__SUKKA_IS_LINUX )); then 177 | export PNPM_HOME="$HOME/.local/share/pnpm" 178 | elif (( $__SUKKA_IS_DARWIN )); then 179 | export PNPM_HOME="$HOME/Library/pnpm" 180 | elif (( $OSTYPE[(I)cygwin] || $OSTYPE[(I)win32] || $OSTYPE[(I)msys] )); then 181 | export PNPM_HOME="$HOME/AppData/Local/pnpm/store" 182 | elif (( $OSTYPE[(I)freebsd] )); then 183 | export PNPM_HOME="$HOME/.pnpm-global" 184 | fi 185 | [[ ! -d "$PNPM_HOME" ]] && mkdir -p $PNPM_HOME 186 | 187 | export GOENV_ROOT="$HOME/.goenv" 188 | export GOPATH="$HOME/go" 189 | 190 | export BAT_THEME="Monokai Extended Bright" 191 | 192 | # Path should be set before fnm (fnm prepend path automatically) 193 | export PATH="${__SUKKA_HOMEBREW__PREFIX}/opt/llvm@16/bin:${__SUKKA_HOMEBREW__PREFIX}/opt/whois/bin:${__SUKKA_HOMEBREW__PREFIX}/opt/curl/bin:$NPM_CONFIG_PREFIX/bin:$PNPM_HOME:$__SUKKA_HOMEBREW__PREFIX/bin:$__SUKKA_HOMEBREW__PREFIX/sbin:/usr/local/bin:/usr/local/sbin:$HOME/bin:$GOENV_ROOT/bin:${HOME}/.local/bin:$GOENV_ROOT/shims:${__SUKKA_HOMEBREW__PREFIX}/opt/openjdk/bin:${__SUKKA_HOMEBREW__PREFIX}/opt/openjdk@8/bin:$PATH:$GOPATH/bin" 194 | 195 | # fnm 196 | if (( $+commands[fnm] )); then 197 | # fnm is installed through package manager 198 | eval "$(fnm env --use-on-cd --corepack-enabled --resolve-engines --shell zsh)" 199 | elif (( $__SUKKA_IS_LINUX] )); then 200 | FNM_PATH="${HOME}/.local/share/fnm" 201 | if [[ -d "$FNM_PATH" ]]; then 202 | # fnm is installed through the shell script 203 | export PATH="$FNM_PATH:$PATH" 204 | eval "$(fnm env --use-on-cd --corepack-enabled --resolve-engines --shell zsh)" 205 | fi 206 | fi 207 | 208 | # rust 209 | if [[ -d "${HOME}/.cargo/bin" ]]; then 210 | export PATH="${HOME}/.cargo/bin:${PATH}" 211 | fi 212 | 213 | # open-cli 214 | # only on non-macOS + open-cli exists 215 | if (( (! ${__SUKKA_IS_DARWIN}) && $+commands[open-cli] )); then 216 | alias open="open-cli" 217 | fi 218 | 219 | # Lazyload Function 220 | 221 | ## Setup a mock function for lazyload 222 | ## Usage: 223 | ## 1. Define function "_sukka_lazyload_command_[command name]" that will init the command 224 | ## 2. sukka_lazyload_add_command [command name] 225 | sukka_lazyload_add_command() { 226 | eval "$1() { \ 227 | unfunction $1; \ 228 | _sukka_lazyload_command_$1; \ 229 | $1 \$@; \ 230 | }" 231 | } 232 | ## Setup autocompletion for lazyload 233 | ## Usage: 234 | ## 1. Define function "_sukka_lazyload_completion_[command name]" that will init the autocompletion 235 | ## 2. sukka_lazyload_add_comp [command name] 236 | sukka_lazyload_add_completion() { 237 | local comp_name="_sukka_lazyload__compfunc_$1" 238 | eval "${comp_name}() { \ 239 | compdef -d $1; \ 240 | _sukka_lazyload_completion_$1; \ 241 | }" 242 | compdef $comp_name $1 243 | } 244 | 245 | alias rezsh="omz reload" 246 | if (( $+commands[code] )); then 247 | alias zshconfig="code $HOME/.zshrc" 248 | elif (( $+commands[we] )); then 249 | alias zshconfig="we $HOME/.zshrc" 250 | else 251 | alias zshconfig="nano $HOME/.zshrc" 252 | fi 253 | 254 | 255 | alias rmrf="rm -rf" 256 | alias gitcm="git commit -m" 257 | alias gitp="git push" 258 | alias gita="git add -a" 259 | alias gitall="git add ." 260 | alias lg="lazygit" 261 | # Git Undo 262 | alias git-undo="git reset --soft HEAD^" 263 | alias tree="tree -aC" 264 | 265 | alias python="python3.11" 266 | alias pip="pip3.11" 267 | 268 | # Git Delete Local Merged 269 | git-delete-local-merged() { 270 | red=$(tput setaf 1) 271 | blue=$(tput setaf 4) 272 | green=$(tput setaf 2) 273 | reset=$(tput sgr0) 274 | 275 | branches=($(git branch --merged master | grep -v "\*\|master\|unstable\|develop")) 276 | 277 | (( ! $#branches )) && printf "${green}\nNo merged branches to delete!${reset}\n" 278 | 279 | command="git branch -d $branches" 280 | 281 | echo "" 282 | printf "%s" "$branches" 283 | echo "" 284 | 285 | printf "\n${blue}Delete merged branches locally? Press [Enter] to continue...${reset}" 286 | read _ 287 | 288 | echo "" 289 | echo "Safely deleting merged local branches..." 290 | 291 | for branch ($branches); do 292 | git branch -d $branch 293 | done 294 | 295 | echo "${green}Done!${reset}" 296 | } 297 | 298 | # homebrew 299 | # brew why 300 | function brew() { 301 | if [[ $1 == "why" ]]; then 302 | brew uses --installed $2 303 | else 304 | command brew "$@" 305 | fi 306 | } 307 | 308 | alias ping="nali-ping" 309 | alias dig="nali-dig" 310 | alias traceroute="nali-traceroute" 311 | alias tracepath="nali-tracepath" 312 | alias nslookup="nali-nslookup" 313 | 314 | # Enable sudo in aliased 315 | # http://askubuntu.com/questions/22037/aliases-not-available-when-using-sudo 316 | alias sudo='sudo ' 317 | 318 | alias q="cd $HOME && clear" 319 | 320 | alias digshort="dig @1.0.0.1 +short " 321 | 322 | # Kills all docker containers running 323 | docker-kill-all() { 324 | docker kill $(docker ps -aq) 325 | } 326 | 327 | cfdns="@1.0.0.1 +tcp" 328 | 329 | alias restart_bluetooth="sudo pkill bluetoothd && sudo launchctl start com.apple.bluetoothd" 330 | 331 | hash -d desktop="$HOME/Desktop" 332 | hash -d music="$HOME/Music" 333 | hash -d pictures="$HOME/Pictures" 334 | hash -d picture="$HOME/Pictures" 335 | hash -d downloads="$HOME/Downloads" 336 | hash -d download="$HOME/Downloads" 337 | hash -d documents="$HOME/Documents" 338 | hash -d document="$HOME/Documents" 339 | hash -d dropbox="$HOME/Dropbox" 340 | hash -d services="$HOME/Services" 341 | hash -d projects="$HOME/Project" 342 | hash -d project="$HOME/Project" 343 | hash -d work="$HOME/Work" 344 | hash -d works="$HOME/Works" 345 | hash -d tools="$HOME/Tools" 346 | hash -d tool="$HOME/Tools" 347 | hash -d applications="/Applications" 348 | hash -d application="/Applications" 349 | hash -d surge="$HOME/Library/Application Support/Surge/Profiles" 350 | hash -d smartdns="$HOME/.config/smartdns" 351 | 352 | alias finder_show="defaults write com.apple.finder AppleShowAllFiles YES" 353 | alias finder_hide="defaults write com.apple.finder AppleShowAllFiles NO" 354 | clear_finder_icon_cache() { 355 | green=$(tput setaf 2) 356 | reset=$(tput sgr0) 357 | printf "${green}%s${reset}\n" '- Cleaning "/Library/Caches/com.apple.iconservices.store" folder ...' 358 | sudo rm -rfv /Library/Caches/com.apple.iconservices.store 359 | printf "${green}%s${reset}\n" '- Cleaning "com.apple.dock.iconcache" and "com.apple.dock.iconcache" files ...' 360 | sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; 361 | sleep 1 362 | sudo touch /Applications/* 363 | printf "${green}%s${reset}\n" '- Restarting Dock & Finder ...' 364 | killall Dock 365 | killall Finder 366 | sleep 2 367 | printf "${green}%s${reset}\n" '- Done!' 368 | } 369 | 370 | clear_dns_cache() { 371 | sudo dscacheutil -flushcache 372 | sudo killall -HUP mDNSResponder 373 | sudo killall mDNSResponderHelper 374 | } 375 | alias flushdns="clear_dns_cache" 376 | 377 | ci-edit-update() { 378 | ( 379 | cd "$HOME/ci_edit" 380 | git pull 381 | ) && sudo "$HOME/ci_edit/install.sh" 382 | } 383 | 384 | git-config() { 385 | echo -n " 386 | =================================== 387 | * Git Configuration * 388 | ----------------------------------- 389 | Please input Git Username: " 390 | 391 | read username 392 | 393 | echo -n " 394 | ----------------------------------- 395 | Please input Git Email: " 396 | 397 | read email 398 | 399 | echo -n " 400 | ----------------------------------- 401 | Done! 402 | =================================== 403 | " 404 | 405 | # git config --global alias.lg "log --graph --abbrev-commit --decorate --all --format=format:\"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\"" 406 | git config --global user.name "${username}" 407 | git config --global user.email "${email}" 408 | } 409 | 410 | brew-why() { 411 | brew uses --installed 412 | } 413 | 414 | # Kills a process running on a specified tcp port 415 | killport() { 416 | echo "Killing process on port: $1" 417 | fuser -n tcp -k $1; 418 | } 419 | 420 | # MVP 421 | # Move and make parent directories 422 | mvp() { 423 | source="$1" 424 | target="$2" 425 | target_dir=${target:h} 426 | mkdir --parents $target_dir; mv $source $target 427 | } 428 | 429 | find_folder_by_name() { 430 | local dir="$1" 431 | local name="$2" 432 | if (( $+commands[fd] )) &>/dev/null; then 433 | fd --color=never -H -I -g --type d $name $dir 434 | else 435 | find $dir -type d -name $name 436 | fi 437 | } 438 | 439 | extract() { 440 | if [[ -f $1 ]]; then 441 | case $1 in 442 | *.tar.bz2) tar xjf $1 ;; 443 | *.tar.gz) tar xzf $1 ;; 444 | *.bz2) bunzip2 $1 ;; 445 | *.rar) unrar e $1 ;; 446 | *.gz) gunzip $1 ;; 447 | *.tar) tar xf $1 ;; 448 | *.tbz2) tar xjf $1 ;; 449 | *.tgz) tar xzf $1 ;; 450 | *.zip) unzip "$1" ;; 451 | *.Z) uncompress $1 ;; 452 | *.7z) 7z x $1 ;; 453 | *) echo "'$1' cannot be extracted via extract()" ;; 454 | esac 455 | else 456 | echo "'$1' is not a valid file" 457 | fi 458 | } 459 | 460 | gitgc() { 461 | red=$(tput setaf 1) 462 | reset=$(tput sgr0) 463 | 464 | ( 465 | cd $HOME/project 466 | find_folder_by_name "$HOME/project" ".git" | while read LINE; do 467 | echo "$red$LINE$reset" 468 | cd ${LINE:h} 469 | git gc 470 | done 471 | ) && echo "${red}Done!${reset}" 472 | } 473 | 474 | # override "omz update" 475 | 476 | update_ohmyzsh_custom_plugins() { 477 | red=$(tput setaf 1) 478 | blue=$(tput setaf 4) 479 | green=$(tput setaf 2) 480 | reset=$(tput sgr0) 481 | 482 | echo "" 483 | printf "${blue}%s${reset}\n" "Upgrading custom plugins" 484 | 485 | find_folder_by_name "${ZSH_CUSTOM:-$ZSH/custom}" ".git" | while read LINE; do 486 | p=${LINE:h} 487 | pushd -q "${p}" 488 | 489 | if git pull --rebase; then 490 | git gc # > /dev/null 2>&1 491 | printf "${green}%s${reset}\n" "${p:t} has been updated and/or is at the current version." 492 | else 493 | printf "${red}%s${reset}\n" "There was an error updating ${p:t}. Try again later?" 494 | fi 495 | popd -q 496 | done 497 | } 498 | 499 | # Load zsh-async worker 500 | # source ${ZSH_CUSTOM:-$ZSH/custom}/plugins/zsh-async/async.zsh 501 | # async_init 502 | 503 | ## Lazyload thefuck 504 | if (( $+commands[thefuck] )) &>/dev/null; then 505 | _sukka_lazyload_command_fuck() { 506 | eval $(thefuck --alias) 507 | } 508 | 509 | sukka_lazyload_add_command fuck 510 | fi 511 | 512 | ## Lazyload pyenv 513 | if (( $+commands[pyenv] )) &>/dev/null; then 514 | _sukka_lazyload_command_pyenv() { 515 | export PATH="${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}" # pyenv init --path 516 | eval "$(command pyenv init -)" 517 | } 518 | sukka_lazyload_add_command pyenv 519 | 520 | _sukka_lazyload_completion_pyenv() { 521 | source "${__SUKKA_HOMEBREW_PYENV_PREFIX}/completions/pyenv.zsh" 522 | } 523 | sukka_lazyload_add_completion pyenv 524 | 525 | export PYENV_ROOT="${PYENV_ROOT:=${HOME}/.pyenv}" 526 | fi 527 | 528 | # hexo completion 529 | if (( $+commands[hexo] )) &>/dev/null; then 530 | _hexo_completion() { 531 | compls=$(hexo --console-list) 532 | completions=(${=compls}) 533 | compadd -- $completions 534 | } 535 | 536 | compdef _hexo_completion hexo 537 | fi 538 | 539 | # gulp completion 540 | if (( $+commands[gulp] )) &>/dev/null; then 541 | _gulp_completion() { 542 | # Grab tasks 543 | compls=$(gulp --tasks-simple) 544 | completions=(${=compls}) 545 | compadd -- $completions 546 | } 547 | 548 | compdef _gulp_completion gulp 549 | fi 550 | 551 | # pnpm 552 | if (( $+commands[pnpm] )) &>/dev/null; then 553 | _pnpm_completion () { 554 | local reply 555 | local si=$IFS 556 | 557 | IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" SHELL=zsh pnpm completion-server -- "${words[@]}")) 558 | IFS=$si 559 | 560 | if [ "$reply" = "__tabtab_complete_files__" ]; then 561 | _files 562 | else 563 | _describe 'values' reply 564 | fi 565 | } 566 | 567 | compdef _pnpm_completion pnpm 568 | fi 569 | # pnpm end 570 | 571 | # npm completion 572 | if (( $+commands[npm] )) &>/dev/null; then 573 | _npm_completion() { 574 | local si=$IFS 575 | compadd -- $(COMP_CWORD=$((CURRENT-1)) COMP_LINE=$BUFFER COMP_POINT=0 npm completion -- "${words[@]}" 2>/dev/null) 576 | IFS=$si 577 | } 578 | compdef _npm_completion npm 579 | fi 580 | 581 | # bun completions 582 | if (( $+commands[bun] )) &>/dev/null; then 583 | _sukka_lazyload_completion_bun() { 584 | [[ -f "${HOME}/.bun/_bun" ]] && source "${HOME}/.bun/_bun" 585 | } 586 | sukka_lazyload_add_completion bun 587 | fi 588 | 589 | # fzf 590 | if (( $+commands[fzf] )) &>/dev/null; then 591 | [[ $- == *i* ]] && source "${__SUKKA_HOMEBREW__PREFIX}/opt/fzf/shell/completion.zsh" 2> /dev/null 592 | fi 593 | 594 | # goenv 595 | if (( $+commands[goenv] )) &>/dev/null; then 596 | _sukka_lazyload_command_goenv() { 597 | eval "$(goenv init -)" 598 | } 599 | 600 | _sukka_lazyload_completion_goenv() { 601 | source "$GOENV_ROOT/completions/goenv.zsh" 602 | } 603 | 604 | sukka_lazyload_add_command goenv 605 | sukka_lazyload_add_completion goenv 606 | fi 607 | 608 | # conda 609 | if (( $+commands[conda] )) &>/dev/null; then 610 | # lazyload conda 611 | __sukka_lazy_conda_aliases=('python' 'conda' 'pip' 'pip3' 'python3') 612 | for lazy_conda_alias in $__sukka_lazy_conda_aliases 613 | do 614 | alias $lazy_conda_alias="__sukka_load_conda && $lazy_conda_alias" 615 | done 616 | 617 | __sukka_load_conda() { 618 | for lazy_conda_alias in $__sukka_lazy_conda_aliases 619 | do 620 | unalias $lazy_conda_alias 621 | done 622 | # >>> conda initialize >>> 623 | # !! Contents within this block are managed by 'conda init' !! 624 | __conda_setup="$('/usr/local/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" 625 | if [ $? -eq 0 ]; then 626 | eval "$__conda_setup" 627 | else 628 | if [[ -f "/usr/local/anaconda3/etc/profile.d/conda.sh" ]]; then 629 | . "/usr/local/anaconda3/etc/profile.d/conda.sh" 630 | else 631 | export PATH="/usr/local/anaconda3/bin:$PATH" 632 | fi 633 | fi 634 | unset __conda_setup 635 | # <<< conda initialize <<< 636 | # export PATH="/usr/local/anaconda3/bin:$PATH" # commented out by conda initialize 637 | 638 | unfunction __sukka_load_conda 639 | } 640 | fi 641 | 642 | # github copilot cli 643 | if (( $+commands[github-copilot-cli] )) &>/dev/null; then 644 | # eval "$(github-copilot-cli alias -- "$0")" 645 | fi 646 | 647 | # zsh-osx-autoproxy (self use) 648 | zsh-osx-autoproxy() { 649 | emulate -L zsh -o extended_glob 650 | # export https_proxy=http://127.0.0.1:6152 651 | # export http_proxy=http://127.0.0.1:6152 652 | # export all_proxy=socks5://127.0.0.1:6153 653 | 654 | # Cache the output of scutil --proxy 655 | local scutil_output=$(scutil --proxy) 656 | local -A info=(${=${(M)${(f)scutil_output}:#[A-Za-z ]# : [^ ]#}/:}) 657 | 658 | local proxy_enabled=0 659 | 660 | if (( $info[HTTPEnable] )); then 661 | export http_proxy=http://$info[HTTPProxy]:$info[HTTPPort] 662 | export HTTP_PROXY=http://$info[HTTPProxy]:$info[HTTPPort] 663 | proxy_enabled=1 664 | fi 665 | if (( $info[HTTPSEnable] )); then 666 | export https_proxy=http://$info[HTTPSProxy]:$info[HTTPSPort] 667 | export HTTPS_PROXY=http://$info[HTTPSProxy]:$info[HTTPSPort] 668 | proxy_enabled=1 669 | fi 670 | if (( $info[FTPSEnable] )); then 671 | export ftp_proxy=http://$info[SOCKSProxy]:$info[SOCKSPort] 672 | export FTP_PROXY=http://$info[SOCKSProxy]:$info[SOCKSPort] 673 | proxy_enabled=1 674 | fi 675 | if (( $info[SOCKSEnable] )); then 676 | export all_proxy=socks5://$info[SOCKSProxy]:$info[SOCKSPort] 677 | export ALL_PROXY=socks5://$info[SOCKSProxy]:$info[SOCKSPort] 678 | proxy_enabled=1 679 | elif (( $info[HTTPEnable] )); then 680 | export all_proxy=http://$info[HTTPProxy]:$info[HTTPPort] 681 | export ALL_PROXY=http://$info[HTTPProxy]:$info[HTTPPort] 682 | proxy_enabled=1 683 | fi 684 | 685 | if (( $proxy_enabled )); then 686 | local -A raw_scutil_noproxy=(${=${(M)${(f)scutil_output}:# [0-9 ]# : [^ ]#}/:}) 687 | local _noproxy=${(j:, :)${(o)raw_scutil_noproxy}} 688 | 689 | export NO_PROXY=$_noproxy 690 | export no_proxy=$_noproxy 691 | fi 692 | } 693 | 694 | noproxy() { 695 | unset http_proxy 696 | unset HTTP_PROXY 697 | unset https_proxy 698 | unset HTTPS_PROXY 699 | unset all_proxy 700 | unset ALL_PROXY 701 | unset ftp_proxy 702 | unset FTP_PROXY 703 | } 704 | 705 | if (( $__SUKKA_IS_DARWIN )); then 706 | zsh-osx-autoproxy 707 | fi 708 | alias proxy="zsh-osx-autoproxy" 709 | 710 | # Add OSX-like shadow to image 711 | # USAGE: osx-shadow [--rm|-r] [result.png] 712 | osx-shadow() { 713 | # Help message 714 | function help { 715 | echo "Wrong number of arguments have been entered." 716 | echo "USAGE: osx-shadow [--rm|-r] [result.png]" 717 | } 718 | 719 | if [[ $1 == --rm || $1 == -r ]]; then 720 | # Remove shadow 721 | case $# in 722 | 3) # osx-shadow --rm|-r src.png dist.png 723 | convert $2 -crop +50+34 -crop -50-66 $3 724 | ;; 725 | 2) # osx-shadow --rm|-r src.png 726 | convert $2 -crop +50+34 -crop -50-66 ${2%.*}-croped.png 727 | ;; 728 | *) 729 | help 730 | ;; 731 | esac 732 | else 733 | # Add shadow 734 | case $# in 735 | 2) # osx-shadow src.png dist.png 736 | convert $1 \( +clone -background gray -shadow 100x40+0+16 \) +swap -background none -layers merge +repage $2 737 | ;; 738 | 1) # osx-shadow src.png 739 | convert $1 \( +clone -background gray -shadow 100x40+0+16 \) +swap -background none -layers merge +repage ${1%.*}-shadow.png 740 | ;; 741 | *) 742 | help 743 | ;; 744 | esac 745 | fi 746 | } 747 | 748 | warp_ip="162.159.192.1" 749 | 750 | sukka_local_ip() { 751 | if (( $__SUKKA_IS_DARWIN )); then 752 | # Get the list of network services and their corresponding devices, remove extra characters 753 | # Use a while loop with read to iterate over each line 754 | local line device deviceinfo ip 755 | 756 | local match=", Device: " 757 | 758 | for line in ${${${(f)"$(networksetup -listnetworkserviceorder)"}##[[:space:]]#}%%[[:space:]]#}; do 759 | if (( $line[(I)$match] )); then 760 | device=${${line#*$match}:0:-1} 761 | deviceinfo=$(ifconfig $device 2>/dev/null) 762 | 763 | if (( ( $deviceinfo[(I)status: active] ) && ( ! $deviceinfo[(I)127.] ) && ( ! $deviceinfo[(I)198.] ) && ( $deviceinfo[(I)inet ] ) )); then 764 | ip=$(ipconfig getifaddr $device 2>/dev/null) 765 | if (( ${#ip} )); then 766 | echo "$ip" 767 | return 0 768 | fi 769 | fi 770 | fi 771 | done 772 | else 773 | local ip=$(ip route show default | grep -Po '(?<=(src ))(\S+)') 774 | if (( $+ip )); then 775 | echo "$ip" 776 | return 0 777 | fi 778 | fi 779 | echo "256.256.256.256" # output invalid ip 780 | return 1 781 | } 782 | 783 | sukka_primary_interface() { 784 | if (( $__SUKKA_IS_DARWIN )); then 785 | local line device deviceinfo ip 786 | 787 | local match=", Device: " 788 | 789 | for line in ${${${(f)"$(networksetup -listnetworkserviceorder)"}##[[:space:]]#}%%[[:space:]]#}; do 790 | if (( $line[(I)$match] )); then 791 | device=${${line#*$match}:0:-1} 792 | deviceinfo=$(ifconfig $device 2>/dev/null) 793 | 794 | if (( ( $deviceinfo[(I)status: active] ) && ( $deviceinfo[(I)inet ] ) )); then 795 | echo "$device" 796 | return 0 797 | fi 798 | fi 799 | done 800 | else 801 | # local route=$(ip route show default) 802 | local device=$(ip route show default | grep -Po '(?<=(dev ))(\S+)') 803 | if (( $+device )); then 804 | echo "$device" 805 | return 0 806 | fi 807 | fi 808 | 809 | return 1 810 | } 811 | 812 | mtu() { 813 | [ -z $1 ] && echo "[MTU] Specifying host is a must" && return 814 | 815 | echo "[MTU] Getting the best MTU value for $1..." 816 | # lan_ip=$(osascript -e "IPv4 address of (system info)") 817 | lan_ip=$(sukka_local_ip) 818 | echo "[MTU] Source IP ${lan_ip}..." 819 | 820 | mtu_result=1500 821 | 822 | command ping -c1 -W1 -D -s $((mtu_result - 28)) "$1" -S ${lan_ip} >/dev/null 2>&1 823 | until [[ $? = 0 || ${mtu_result} -le 1000 ]]; do 824 | mtu_result=$(( ${mtu_result} - 16)) 825 | echo "[MTU] Ping ${mtu_result}" 826 | command ping -c1 -W1 -D -s $((mtu_result - 28)) "$1" -S ${lan_ip} >/dev/null 2>&1 827 | done 828 | 829 | if [[ "${mtu_result}" -eq 1500 ]]; then 830 | # do nothing 831 | elif [[ "${mtu_result}" -le 1000 ]]; then 832 | mtu_result=1000 833 | else 834 | for (( i=0; i<16; i++ )); do 835 | (( mtu_result++ )) 836 | echo "[MTU] Ping ${mtu_result}" 837 | ( command ping -c1 -W1 -D -s $((mtu_result - 28)) "$1" -S ${lan_ip} >/dev/null 2>&1 ) || break 838 | done 839 | (( mtu_result-- )) 840 | fi 841 | 842 | echo "[MTU] MTU: ${mtu_result}. WireGuard MTU: $(( mtu_result - 80 ))" 843 | } 844 | 845 | mtrskk() { 846 | "sudo" mtr -b -z -e -m 63 -a $(sukka_local_ip) $@ | nali 847 | } 848 | 849 | traceskk() { 850 | "sudo" "nexttrace" --always-rdns --source $(sukka_local_ip) $@ 851 | } 852 | 853 | pastefile() { 854 | for filepath in "$@" 855 | do 856 | echo $(curl -F "reqtype=fileupload" --progress-bar -F "time=1h" -F "fileToUpload=@$filepath" https://litterbox.catbox.moe/resources/internals/api.php) 857 | # echo $(curl --progress-bar -F "file=@$filepath" https://tmpfiles.org/api/v1/upload) # server error when uploading some files 858 | # echo $(curl --progress-bar -F "file=@$filepath" https://temp.sh/upload) 859 | done 860 | } 861 | alias tmpfile="pastefile" 862 | 863 | # Add npm package manager prompt to powerlevel10k 864 | prompt_sukka_npm_type() { 865 | if (( $+commands[node] || $+commands[yarn] || $+commands[npm] || $+commands[pnpm] || $+commands[bun] )) &>/dev/null; then 866 | _p9k_upglob pnpm-lock.yaml 867 | (( $? == 1 )) && { 868 | p10k segment -s "PNPM" -f yellow -t "pnpm" 869 | return 870 | } 871 | _p9k_upglob bun.lockb 872 | (( $? == 1 )) && { 873 | p10k segment -s "BUN" -f white -t "bun" 874 | return 875 | } 876 | _p9k_upglob yarn.lock 877 | (( $? == 1 )) && { 878 | p10k segment -s "YARN" -f blue -t "yarn" 879 | return 880 | } 881 | _p9k_upglob package-lock.json 882 | (( $? == 1 )) && { 883 | p10k segment -s "NPM" -f red -t "npm" 884 | return 885 | } 886 | _p9k_upglob package.json 887 | (( $? == 1 )) && { 888 | p10k segment -s "NPM" -f red -t "npm" 889 | return 890 | } 891 | fi 892 | } 893 | # Add my ip prompt to powerlevel10k 894 | prompt_sukka_custom_ip() { 895 | local -i len=$#_p9k__prompt _p9k__has_upglob 896 | local ip='${_p9k__public_ip:-$_POWERLEVEL9K_PUBLIC_IP_NONE}' 897 | _p9k_prompt_segment "$0" "$_p9k_color1" "$_p9k_color2" PUBLIC_IP_ICON 1 $ip $ip 898 | (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] 899 | } 900 | _p9k_prompt_sukka_custom_ip_init() { 901 | typeset -g _p9k__= 902 | typeset -gF _p9k__public_ip_next_time=0 903 | _p9k__async_segments_compute+='_p9k_worker_invoke public_ip _p9k_prompt_sukka_custom_ip_compute' 904 | } 905 | _p9k_prompt_sukka_custom_ip_compute() { 906 | (( EPOCHREALTIME >= _p9k__public_ip_next_time )) || return 907 | _p9k_worker_async _p9k_prompt_sukka_custom_ip_async _p9k_prompt_sukka_custom_ip_sync 908 | } 909 | _p9k_prompt_sukka_custom_ip_async() { 910 | local ip 911 | local -F start=EPOCHREALTIME 912 | local -F next='start + 5' 913 | if (( $+commands[curl] )); then 914 | ip="$(curl --max-time 5 -w '\n' "https://plain-sky-8db5.skk.workers.dev" 2>/dev/null)" 915 | fi 916 | if (( $+ip )); then 917 | next=$((start + 240)) 918 | fi 919 | _p9k__public_ip_next_time=$next 920 | _p9k_print_params _p9k__public_ip_next_time 921 | [[ $_p9k__public_ip == $ip ]] && return 922 | _p9k__public_ip=$ip 923 | _p9k_print_params _p9k__public_ip 924 | echo -E - 'reset=1' 925 | } 926 | _p9k_prompt_sukka_custom_ip_sync() { 927 | eval $REPLY 928 | _p9k_worker_reply $REPLY 929 | } 930 | 931 | # This speeds up pasting w/ autosuggest 932 | # https://github.com/zsh-users/zsh-autosuggestions/issues/238 933 | pasteinit() { 934 | OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]} 935 | zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`? 936 | } 937 | pastefinish() { 938 | zle -N self-insert $OLD_SELF_INSERT 939 | } 940 | zstyle :bracketed-paste-magic paste-init pasteinit 941 | zstyle :bracketed-paste-magic paste-finish pastefinish 942 | # https://github.com/zsh-users/zsh-autosuggestions/issues/351 943 | ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(bracketed-paste accept-line) 944 | # Enable completion in zsh-autosuggestions 945 | ZSH_AUTOSUGGEST_STRATEGY=(history completion) 946 | ZSH_AUTOSUGGEST_MANUAL_REBIND=1 947 | 948 | if (( $SUKKA_ENABLE_PERFORMANCE_PROFILING )); then 949 | unsetopt XTRACE 950 | exec 2>&3 3>&- 951 | 952 | parse_zsh_profiling() { 953 | typeset -a lines 954 | typeset -i prev_time=0 955 | typeset prev_command 956 | 957 | while read line; do 958 | if [[ $line =~ '^.*\+([0-9]{10})\.([0-9]{6})[0-9]* (.+)' ]]; then 959 | integer this_time=$match[1]$match[2] 960 | 961 | if [[ $prev_time -gt 0 ]]; then 962 | time_difference=$(( $this_time - $prev_time )) 963 | lines+="$time_difference $prev_command" 964 | fi 965 | 966 | prev_time=$this_time 967 | 968 | local this_command=$match[3] 969 | if [[ ${#this_command} -le 80 ]]; then 970 | prev_command=$this_command 971 | else 972 | prev_command="${this_command:0:77}..." 973 | fi 974 | fi 975 | done < ${1:-/dev/stdin} 976 | 977 | print -l ${(@On)lines} 978 | } 979 | 980 | zprof() { 981 | unfunction zprof 982 | 983 | parse_zsh_profiling $__sukka_zsh_profiling_logfile | head -n 50 984 | 985 | echo "" 986 | echo "========================================" 987 | echo "" 988 | 989 | zprof $@ 990 | } 991 | fi 992 | 993 | # Store commands in history only if successful 994 | # CREDITS: 995 | # https://gist.github.com/danydev/4ca4f5c523b19b17e9053dfa9feb246d 996 | # https://scarff.id.au/blog/2019/zsh-history-conditional-on-command-success/ 997 | 998 | function __fd18et_prevent_write() { 999 | __fd18et_LASTHIST=$1 1000 | return 2 1001 | } 1002 | function __fd18et_save_last_successed() { 1003 | if [[ ($? == 0 || $? == 130) && -n $__fd18et_LASTHIST && -n $HISTFILE ]] ; then 1004 | print -sr -- ${=${__fd18et_LASTHIST%%'\n'}} 1005 | fi 1006 | } 1007 | add-zsh-hook zshaddhistory __fd18et_prevent_write 1008 | add-zsh-hook precmd __fd18et_save_last_successed 1009 | add-zsh-hook zshexit __fd18et_save_last_successed 1010 | 1011 | bindkey '^[^M' self-insert-unmeta 1012 | --------------------------------------------------------------------------------