├── .devcontainer └── devcontainer.json ├── .gitignore ├── .vscode └── settings.json ├── README.md ├── composer.json ├── docker-compose.yml ├── docker └── 8.2 │ ├── .p10k.zsh │ ├── .zshrc │ ├── Dockerfile │ ├── php.ini │ ├── start-container │ └── supervisord.conf ├── phive ├── phive.xml ├── phpcs.xml ├── phpmd.xml ├── src └── GeneaLabs │ ├── Sniffs │ ├── TypeHinting │ │ ├── MethodParameterTypeHintSniff.php │ │ └── ReturnTypeSniff.php │ └── Whitespace │ │ ├── EmptyLineAroundControlStructureSniff.php │ │ ├── EmptyLineBeforeReturnSniff.php │ │ └── MultipleEmptyLinesSniff.php │ └── ruleset.xml └── tools ├── CodeSniffer.conf ├── phpcs ├── phploc ├── phpmd ├── phpstan └── phpunit /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // https://aka.ms/devcontainer.json 2 | { 3 | "name": "Existing Docker Compose (Extend)", 4 | "dockerComposeFile": [ 5 | "../docker-compose.yml" 6 | ], 7 | "service": "laravel.test", 8 | "workspaceFolder": "/var/www/html", 9 | "customizations": { 10 | "vscode": { 11 | "settings": {}, 12 | "extensions": [ 13 | "adrianwilczynski.alpine-js-intellisense", 14 | "amiralizadeh9480.laravel-extra-intellisense", 15 | "austenc.laravel-blade-spacer", 16 | "beyondcode.tinkerwell", 17 | "bradlc.vscode-tailwindcss", 18 | "christian-kohler.npm-intellisense", 19 | "christian-kohler.path-intellisense", 20 | "cierra.livewire-vscode", 21 | "codingyu.laravel-goto-view", 22 | "davidanson.vscode-markdownlint", 23 | "eamodio.gitlens", 24 | "ecodes.vscode-phpmd", 25 | "editorconfig.editorconfig", 26 | "ericcheng.codesongclear", 27 | "faelv.composer-companion", 28 | "file-icons.file-icons", 29 | "georgykurian.laravel-ide-helper", 30 | "github.codespaces", 31 | "github.vscode-pull-request-github", 32 | "heybourn.headwind", 33 | "irongeek.vscode-env", 34 | "mahmoudshahin.laravel-routes", 35 | "martybegood.single-editor-tabs", 36 | "mechatroner.rainbow-csv", 37 | "mehedidracula.php-namespace-resolver", 38 | "mikestead.dotenv", 39 | "mohamedbenhida.laravel-intellisense", 40 | "mrmlnc.vscode-duplicate", 41 | "ms-vscode-remote.remote-ssh-edit", 42 | "ms-vscode-remote.remote-ssh", 43 | "naoray.laravel-goto-components", 44 | "oderwat.indent-rainbow", 45 | "pcbowers.alpine-intellisense", 46 | "redhat.vscode-yaml", 47 | "rifi2k.format-html-in-php", 48 | "shevaua.phpcs", 49 | "shufo.vscode-blade-formatter", 50 | "sperovita.alpinejs-syntax-highlight", 51 | "streetsidesoftware.code-spell-checker", 52 | "syler.ignore", 53 | "teabyii.ayu", 54 | "usernamehw.errorlens", 55 | "vincaslt.highlight-matching-tag", 56 | "wakatime.vscode-wakatime", 57 | "wongjn.php-sniffer", 58 | "WakaTime.vscode-wakatime", 59 | "MehediDracula.php-namespace-resolver", 60 | "bmewburn.vscode-intelephense-client", 61 | "DavidAnson.vscode-markdownlint", 62 | "MahmoudShahin.laravel-routes", 63 | "Syler.ignore", 64 | "IronGeek.vscode-env", 65 | "EditorConfig.EditorConfig", 66 | "huibizhang.codesnap-plus", 67 | "m4ns0ur.base64" 68 | ] 69 | } 70 | }, 71 | "remoteUser": "sail", 72 | "postCreateCommand": "chown -R 1000:1000 /var/www/html", 73 | "forwardPorts": [ 74 | 80, 75 | 5432 76 | ], 77 | "portsAttributes": { 78 | "80": { 79 | "label": "HTTP" 80 | }, 81 | "5432": { 82 | "label": "Postgres" 83 | } 84 | } 85 | // "runServices": [], 86 | // "shutdownAction": "none", 87 | } 88 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | /composer.lock 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "autoload", 4 | "Bronner", 5 | "codesniffer", 6 | "dealerdirect", 7 | "Genea", 8 | "genealabs", 9 | "phpcodesniffer", 10 | "slevomat", 11 | "squizlabs" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GeneaLabs PHP Coding Standards 2 | Custom PHPCS sniffs that support all our coding standards. 3 | 4 | ## Installation 5 | There are several ways to install this ruleset: 6 | 1. Add the following to your composer.json scripts section: 7 | ``` 8 | "post-update-cmd" : [ 9 | "tools/phpcs --config-set installed_paths vendor/genealabs/php-coding-standards/src/GeneaLabs" 10 | ] 11 | ``` 12 | 2. Or add the following to your phpcs.xml file: 13 | ``` 14 | 15 | 16 | 17 | ``` 18 | 19 | ## Custom Rules 20 | ### Type Hinting 21 | - Method Parameter Type Hints 22 | - Method Return Type Hints 23 | 24 | ### Whitespace 25 | - Empty Lines Acound Control Structures 26 | - Empyt Line Before Returns 27 | - No Mutliple Consecutive Empty Lines 28 | 29 | ## Adopted Rules 30 | - PSR1 31 | - PSR2 32 | - PSR12 33 | - except: PSR12.Classes.ClassInstantiation.MissingParentheses, as we want to new up classes without parenthesis. 34 | - Internal.NoCodeFound 35 | - Zend.Files.ClosingTag 36 | - Zend.NamingConventions 37 | - except: Zend.NamingConventions.ValidVariableName.PrivateNoUnderscore, as we want all variables and properties to be in camelCase. 38 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "genealabs/php-coding-standards", 3 | "type": "library", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Mike Bronner", 8 | "email": "hello@genealabs.com" 9 | } 10 | ], 11 | "require": { 12 | "php": "^8.0", 13 | "slevomat/coding-standard": "^8.8", 14 | "squizlabs/php_codesniffer": "^3.7" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "GeneaLabs\\PhpCodingStandards\\": "src/" 19 | } 20 | }, 21 | "minimum-stability": "dev", 22 | "prefer-stable": true, 23 | "config": { 24 | "allow-plugins": { 25 | "dealerdirect/phpcodesniffer-composer-installer": true 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # For more information: https://laravel.com/docs/sail 2 | version: '3' 3 | services: 4 | laravel.test: 5 | build: 6 | context: ./docker/8.2 7 | dockerfile: Dockerfile 8 | args: 9 | WWWGROUP: '${WWWGROUP}' 10 | image: sail-8.2/app 11 | extra_hosts: 12 | - 'host.docker.internal:host-gateway' 13 | ports: 14 | - '${APP_PORT:-80}:80' 15 | - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' 16 | environment: 17 | WWWUSER: '${WWWUSER}' 18 | LARAVEL_SAIL: 1 19 | XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' 20 | XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' 21 | volumes: 22 | - '.:/var/www/html' 23 | networks: 24 | - sail 25 | networks: 26 | sail: 27 | driver: bridge 28 | -------------------------------------------------------------------------------- /docker/8.2/.p10k.zsh: -------------------------------------------------------------------------------- 1 | # Generated by Powerlevel10k configuration wizard on 2022-10-29 at 09:39 MST. 2 | # Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 59558. 3 | # Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time, 4 | # 2 lines, dotted, full frame, darkest-ornaments, sparse, many icons, fluent, 5 | # instant_prompt=quiet. 6 | # Type `p10k configure` to generate another config. 7 | # 8 | # Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate 9 | # your own config based on it. 10 | # 11 | # Tip: Looking for a nice color? Here's a one-liner to print colormap. 12 | # 13 | # for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done 14 | 15 | # Temporarily change options. 16 | 'builtin' 'local' '-a' 'p10k_config_opts' 17 | [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') 18 | [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') 19 | [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') 20 | 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' 21 | 22 | () { 23 | emulate -L zsh -o extended_glob 24 | 25 | # Unset all configuration options. This allows you to apply configuration changes without 26 | # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. 27 | unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' 28 | 29 | # Zsh >= 5.1 is required. 30 | autoload -Uz is-at-least && is-at-least 5.1 || return 31 | 32 | # The list of segments shown on the left. Fill it with the most important segments. 33 | typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( 34 | # =========================[ Line #1 ]========================= 35 | os_icon # os identifier 36 | dir # current directory 37 | vcs # git status 38 | # =========================[ Line #2 ]========================= 39 | newline # \n 40 | prompt_char # prompt symbol 41 | ) 42 | 43 | # The list of segments shown on the right. Fill it with less important segments. 44 | # Right prompt on the last prompt line (where you are typing your commands) gets 45 | # automatically hidden when the input line reaches it. Right prompt above the 46 | # last prompt line gets hidden if it would overlap with left prompt. 47 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( 48 | # =========================[ Line #1 ]========================= 49 | status # exit code of the last command 50 | command_execution_time # duration of the last command 51 | background_jobs # presence of background jobs 52 | direnv # direnv status (https://direnv.net/) 53 | asdf # asdf version manager (https://github.com/asdf-vm/asdf) 54 | virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) 55 | anaconda # conda environment (https://conda.io/) 56 | pyenv # python environment (https://github.com/pyenv/pyenv) 57 | goenv # go environment (https://github.com/syndbg/goenv) 58 | nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) 59 | nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) 60 | nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) 61 | # node_version # node.js version 62 | # go_version # go version (https://golang.org) 63 | # rust_version # rustc version (https://www.rust-lang.org) 64 | # dotnet_version # .NET version (https://dotnet.microsoft.com) 65 | # php_version # php version (https://www.php.net/) 66 | # laravel_version # laravel php framework version (https://laravel.com/) 67 | # java_version # java version (https://www.java.com/) 68 | # package # name@version from package.json (https://docs.npmjs.com/files/package.json) 69 | rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) 70 | rvm # ruby version from rvm (https://rvm.io) 71 | fvm # flutter version management (https://github.com/leoafarias/fvm) 72 | luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) 73 | jenv # java version from jenv (https://github.com/jenv/jenv) 74 | plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 75 | phpenv # php version from phpenv (https://github.com/phpenv/phpenv) 76 | scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) 77 | haskell_stack # haskell version from stack (https://haskellstack.org/) 78 | kubecontext # current kubernetes context (https://kubernetes.io/) 79 | terraform # terraform workspace (https://www.terraform.io) 80 | # terraform_version # terraform version (https://www.terraform.io) 81 | aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) 82 | aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) 83 | azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) 84 | gcloud # google cloud cli account and project (https://cloud.google.com/) 85 | google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) 86 | toolbox # toolbox name (https://github.com/containers/toolbox) 87 | context # user@hostname 88 | nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) 89 | ranger # ranger shell (https://github.com/ranger/ranger) 90 | nnn # nnn shell (https://github.com/jarun/nnn) 91 | xplr # xplr shell (https://github.com/sayanarijit/xplr) 92 | vim_shell # vim shell indicator (:sh) 93 | midnight_commander # midnight commander shell (https://midnight-commander.org/) 94 | nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) 95 | # vpn_ip # virtual private network indicator 96 | # load # CPU load 97 | # disk_usage # disk usage 98 | # ram # free RAM 99 | # swap # used swap 100 | todo # todo items (https://github.com/todotxt/todo.txt-cli) 101 | timewarrior # timewarrior tracking status (https://timewarrior.net/) 102 | taskwarrior # taskwarrior task count (https://taskwarrior.org/) 103 | time # current time 104 | # =========================[ Line #2 ]========================= 105 | newline 106 | # ip # ip address and bandwidth usage for a specified network interface 107 | # public_ip # public IP address 108 | # proxy # system-wide http/https/ftp proxy 109 | # battery # internal battery 110 | # wifi # wifi speed 111 | # example # example user-defined segment (see prompt_example function below) 112 | ) 113 | 114 | # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. 115 | typeset -g POWERLEVEL9K_MODE=nerdfont-complete 116 | # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid 117 | # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. 118 | typeset -g POWERLEVEL9K_ICON_PADDING=none 119 | 120 | # Basic style options that define the overall look of your prompt. You probably don't want to 121 | # change them. 122 | typeset -g POWERLEVEL9K_BACKGROUND= # transparent background 123 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace 124 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space 125 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol 126 | 127 | # When set to true, icons appear before content on both sides of the prompt. When set 128 | # to false, icons go after content. If empty or not set, icons go before content in the left 129 | # prompt and after content in the right prompt. 130 | # 131 | # You can also override it for a specific segment: 132 | # 133 | # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false 134 | # 135 | # Or for a specific segment in specific state: 136 | # 137 | # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false 138 | typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true 139 | 140 | # Add an empty line before each prompt. 141 | typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true 142 | 143 | # Connect left prompt lines with these symbols. 144 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%238F╭─' 145 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%238F├─' 146 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%238F╰─' 147 | # Connect right prompt lines with these symbols. 148 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%238F─╮' 149 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%238F─┤' 150 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%238F─╯' 151 | 152 | # The left end of left prompt. 153 | typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' 154 | # The right end of right prompt. 155 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' 156 | 157 | # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll 158 | # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and 159 | # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. 160 | typeset -g POWERLEVEL9K_SHOW_RULER=false 161 | typeset -g POWERLEVEL9K_RULER_CHAR='─' # reasonable alternative: '·' 162 | typeset -g POWERLEVEL9K_RULER_FOREGROUND=238 163 | 164 | # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─' 165 | # to make it easier to see the alignment between left and right prompt and to separate prompt 166 | # from command output. It serves the same purpose as ruler (see above) without increasing 167 | # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false 168 | # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact 169 | # prompt. 170 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='·' 171 | if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then 172 | # The color of the filler. 173 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238 174 | # Add a space between the end of left prompt and the filler. 175 | typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' 176 | # Add a space between the filler and the start of right prompt. 177 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' 178 | # Start filler from the edge of the screen if there are no left segments on the first line. 179 | typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' 180 | # End filler on the edge of the screen if there are no right segments on the first line. 181 | typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' 182 | fi 183 | 184 | #################################[ os_icon: os identifier ]################################## 185 | # OS identifier color. 186 | typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= 187 | # Custom icon. 188 | # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' 189 | 190 | ################################[ prompt_char: prompt symbol ]################################ 191 | # Green prompt symbol if the last command succeeded. 192 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 193 | # Red prompt symbol if the last command failed. 194 | typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 195 | # Default prompt symbol. 196 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' 197 | # Prompt symbol in command vi mode. 198 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' 199 | # Prompt symbol in visual vi mode. 200 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' 201 | # Prompt symbol in overwrite vi mode. 202 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' 203 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true 204 | # No line terminator if prompt_char is the last segment. 205 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' 206 | # No line introducer if prompt_char is the first segment. 207 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= 208 | 209 | ##################################[ dir: current directory ]################################## 210 | # Default current directory color. 211 | typeset -g POWERLEVEL9K_DIR_FOREGROUND=31 212 | # If directory is too long, shorten some of its segments to the shortest possible unique 213 | # prefix. The shortened directory can be tab-completed to the original. 214 | typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique 215 | # Replace removed segment suffixes with this symbol. 216 | typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= 217 | # Color of the shortened directory segments. 218 | typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103 219 | # Color of the anchor directory segments. Anchor segments are never shortened. The first 220 | # segment is always an anchor. 221 | typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39 222 | # Display anchor directory segments in bold. 223 | typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true 224 | # Don't shorten directories that contain any of these files. They are anchors. 225 | local anchor_files=( 226 | .bzr 227 | .citc 228 | .git 229 | .hg 230 | .node-version 231 | .python-version 232 | .go-version 233 | .ruby-version 234 | .lua-version 235 | .java-version 236 | .perl-version 237 | .php-version 238 | .tool-version 239 | .shorten_folder_marker 240 | .svn 241 | .terraform 242 | CVS 243 | Cargo.toml 244 | composer.json 245 | go.mod 246 | package.json 247 | stack.yaml 248 | ) 249 | typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" 250 | # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains 251 | # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is 252 | # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) 253 | # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers 254 | # and other directories don't. 255 | # 256 | # Optionally, "first" and "last" can be followed by ":" where is an integer. 257 | # This moves the truncation point to the right (positive offset) or to the left (negative offset) 258 | # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" 259 | # respectively. 260 | typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false 261 | # Don't shorten this many last directory segments. They are anchors. 262 | typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 263 | # Shorten directory if it's longer than this even if there is space for it. The value can 264 | # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, 265 | # directory will be shortened only when prompt doesn't fit or when other parameters demand it 266 | # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). 267 | # If set to `0`, directory will always be shortened to its minimum length. 268 | typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 269 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this 270 | # many columns for typing commands. 271 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 272 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least 273 | # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. 274 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 275 | # If set to true, embed a hyperlink into the directory. Useful for quickly 276 | # opening a directory in the file manager simply by clicking the link. 277 | # Can also be handy when the directory is shortened, as it allows you to see 278 | # the full directory that was used in previous commands. 279 | typeset -g POWERLEVEL9K_DIR_HYPERLINK=false 280 | 281 | # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON 282 | # and POWERLEVEL9K_DIR_CLASSES below. 283 | typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 284 | 285 | # The default icon shown next to non-writable and non-existent directories when 286 | # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. 287 | # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' 288 | 289 | # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different 290 | # directories. It must be an array with 3 * N elements. Each triplet consists of: 291 | # 292 | # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with 293 | # extended_glob option enabled. 294 | # 2. Directory class for the purpose of styling. 295 | # 3. An empty string. 296 | # 297 | # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. 298 | # 299 | # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories 300 | # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. 301 | # 302 | # For example, given these settings: 303 | # 304 | # typeset -g POWERLEVEL9K_DIR_CLASSES=( 305 | # '~/work(|/*)' WORK '' 306 | # '~(|/*)' HOME '' 307 | # '*' DEFAULT '') 308 | # 309 | # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one 310 | # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or 311 | # WORK_NON_EXISTENT. 312 | # 313 | # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an 314 | # option to define custom colors and icons for different directory classes. 315 | # 316 | # # Styling for WORK. 317 | # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' 318 | # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=31 319 | # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=103 320 | # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=39 321 | # 322 | # # Styling for WORK_NOT_WRITABLE. 323 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' 324 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=31 325 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 326 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 327 | # 328 | # # Styling for WORK_NON_EXISTENT. 329 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' 330 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 331 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 332 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 333 | # 334 | # If a styling parameter isn't explicitly defined for some class, it falls back to the classless 335 | # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls 336 | # back to POWERLEVEL9K_DIR_FOREGROUND. 337 | # 338 | # typeset -g POWERLEVEL9K_DIR_CLASSES=() 339 | 340 | # Custom prefix. 341 | # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' 342 | 343 | #####################################[ vcs: git status ]###################################### 344 | # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. 345 | typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' 346 | 347 | # Untracked files icon. It's really a question mark, your font isn't broken. 348 | # Change the value of this parameter to show a different icon. 349 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' 350 | 351 | # Formatter for Git status. 352 | # 353 | # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. 354 | # 355 | # You can edit the function to customize how Git status looks. 356 | # 357 | # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: 358 | # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. 359 | function my_git_formatter() { 360 | emulate -L zsh 361 | 362 | if [[ -n $P9K_CONTENT ]]; then 363 | # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from 364 | # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. 365 | typeset -g my_git_format=$P9K_CONTENT 366 | return 367 | fi 368 | 369 | if (( $1 )); then 370 | # Styling for up-to-date Git status. 371 | local meta='%f' # default foreground 372 | local clean='%76F' # green foreground 373 | local modified='%178F' # yellow foreground 374 | local untracked='%39F' # blue foreground 375 | local conflicted='%196F' # red foreground 376 | else 377 | # Styling for incomplete and stale Git status. 378 | local meta='%244F' # grey foreground 379 | local clean='%244F' # grey foreground 380 | local modified='%244F' # grey foreground 381 | local untracked='%244F' # grey foreground 382 | local conflicted='%244F' # grey foreground 383 | fi 384 | 385 | local res 386 | 387 | if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then 388 | local branch=${(V)VCS_STATUS_LOCAL_BRANCH} 389 | # If local branch name is at most 32 characters long, show it in full. 390 | # Otherwise show the first 12 … the last 12. 391 | # Tip: To always show local branch name in full without truncation, delete the next line. 392 | (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line 393 | res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" 394 | fi 395 | 396 | if [[ -n $VCS_STATUS_TAG 397 | # Show tag only if not on a branch. 398 | # Tip: To always show tag, delete the next line. 399 | && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line 400 | ]]; then 401 | local tag=${(V)VCS_STATUS_TAG} 402 | # If tag name is at most 32 characters long, show it in full. 403 | # Otherwise show the first 12 … the last 12. 404 | # Tip: To always show tag name in full without truncation, delete the next line. 405 | (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line 406 | res+="${meta}#${clean}${tag//\%/%%}" 407 | fi 408 | 409 | # Display the current Git commit if there is no branch and no tag. 410 | # Tip: To always display the current Git commit, delete the next line. 411 | [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line 412 | res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" 413 | 414 | # Show tracking branch name if it differs from local branch. 415 | if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then 416 | res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" 417 | fi 418 | 419 | # Display "wip" if the latest commit's summary contains "wip" or "WIP". 420 | if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then 421 | res+=" ${modified}wip" 422 | fi 423 | 424 | # ⇣42 if behind the remote. 425 | (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" 426 | # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. 427 | (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " 428 | (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" 429 | # ⇠42 if behind the push remote. 430 | (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" 431 | (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " 432 | # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. 433 | (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" 434 | # *42 if have stashes. 435 | (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" 436 | # 'merge' if the repo is in an unusual state. 437 | [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" 438 | # ~42 if have merge conflicts. 439 | (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" 440 | # +42 if have staged changes. 441 | (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" 442 | # !42 if have unstaged changes. 443 | (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" 444 | # ?42 if have untracked files. It's really a question mark, your font isn't broken. 445 | # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. 446 | # Remove the next line if you don't want to see untracked files at all. 447 | (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" 448 | # "─" if the number of unstaged files is unknown. This can happen due to 449 | # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower 450 | # than the number of files in the Git index, or due to bash.showDirtyState being set to false 451 | # in the repository config. The number of staged and untracked files may also be unknown 452 | # in this case. 453 | (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" 454 | 455 | typeset -g my_git_format=$res 456 | } 457 | functions -M my_git_formatter 2>/dev/null 458 | 459 | # Don't count the number of unstaged, untracked and conflicted files in Git repositories with 460 | # more than this many files in the index. Negative value means infinity. 461 | # 462 | # If you are working in Git repositories with tens of millions of files and seeing performance 463 | # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output 464 | # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's 465 | # config: `git config bash.showDirtyState false`. 466 | typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 467 | 468 | # Don't show Git status in prompt for repositories whose workdir matches this pattern. 469 | # For example, if set to '~', the Git repository at $HOME/.git will be ignored. 470 | # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. 471 | typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' 472 | 473 | # Disable the default Git status formatting. 474 | typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true 475 | # Install our own Git status formatter. 476 | typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' 477 | typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' 478 | # Enable counters for staged, unstaged, etc. 479 | typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 480 | 481 | # Icon color. 482 | typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 483 | typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244 484 | # Custom icon. 485 | # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' 486 | # Custom prefix. 487 | typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' 488 | 489 | # Show status of repositories of these types. You can add svn and/or hg if you are 490 | # using them. If you do, your prompt may become slow even when your current directory 491 | # isn't in an svn or hg reposotiry. 492 | typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) 493 | 494 | # These settings are used for repositories other than Git or when gitstatusd fails and 495 | # Powerlevel10k has to fall back to using vcs_info. 496 | typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 497 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 498 | typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178 499 | 500 | ##########################[ status: exit code of the last command ]########################### 501 | # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and 502 | # style them independently from the regular OK and ERROR state. 503 | typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true 504 | 505 | # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as 506 | # it will signify success by turning green. 507 | typeset -g POWERLEVEL9K_STATUS_OK=false 508 | typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70 509 | typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' 510 | 511 | # Status when some part of a pipe command fails but the overall exit status is zero. It may look 512 | # like this: 1|0. 513 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true 514 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70 515 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' 516 | 517 | # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as 518 | # it will signify error by turning red. 519 | typeset -g POWERLEVEL9K_STATUS_ERROR=false 520 | typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160 521 | typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' 522 | 523 | # Status when the last command was terminated by a signal. 524 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true 525 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160 526 | # Use terse signal names: "INT" instead of "SIGINT(2)". 527 | typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false 528 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' 529 | 530 | # Status when some part of a pipe command fails and the overall exit status is also non-zero. 531 | # It may look like this: 1|0. 532 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true 533 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160 534 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' 535 | 536 | ###################[ command_execution_time: duration of the last command ]################### 537 | # Show duration of the last command if takes at least this many seconds. 538 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 539 | # Show this many fractional digits. Zero means round to seconds. 540 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 541 | # Execution time color. 542 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 543 | # Duration format: 1d 2h 3m 4s. 544 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' 545 | # Custom icon. 546 | # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' 547 | # Custom prefix. 548 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' 549 | 550 | #######################[ background_jobs: presence of background jobs ]####################### 551 | # Don't show the number of background jobs. 552 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false 553 | # Background jobs color. 554 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70 555 | # Custom icon. 556 | # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' 557 | 558 | #######################[ direnv: direnv status (https://direnv.net/) ]######################## 559 | # Direnv color. 560 | typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178 561 | # Custom icon. 562 | # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 563 | 564 | ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### 565 | # Default asdf color. Only used to display tools for which there is no color override (see below). 566 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. 567 | typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 568 | 569 | # There are four parameters that can be used to hide asdf tools. Each parameter describes 570 | # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at 571 | # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to 572 | # hide a tool, it gets shown. 573 | # 574 | # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and 575 | # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: 576 | # 577 | # asdf local python 3.8.1 578 | # asdf global python 3.8.1 579 | # 580 | # After running both commands the current python version is 3.8.1 and its source is "local" as 581 | # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, 582 | # it'll hide python version in this case because 3.8.1 is the same as the global version. 583 | # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't 584 | # contain "local". 585 | 586 | # Hide tool versions that don't come from one of these sources. 587 | # 588 | # Available sources: 589 | # 590 | # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" 591 | # - local `asdf current` says "set by /some/not/home/directory/file" 592 | # - global `asdf current` says "set by /home/username/file" 593 | # 594 | # Note: If this parameter is set to (shell local global), it won't hide tools. 595 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. 596 | typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) 597 | 598 | # If set to false, hide tool versions that are the same as global. 599 | # 600 | # Note: The name of this parameter doesn't reflect its meaning at all. 601 | # Note: If this parameter is set to true, it won't hide tools. 602 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. 603 | typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false 604 | 605 | # If set to false, hide tool versions that are equal to "system". 606 | # 607 | # Note: If this parameter is set to true, it won't hide tools. 608 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. 609 | typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true 610 | 611 | # If set to non-empty value, hide tools unless there is a file matching the specified file pattern 612 | # in the current directory, or its parent directory, or its grandparent directory, and so on. 613 | # 614 | # Note: If this parameter is set to empty value, it won't hide tools. 615 | # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. 616 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. 617 | # 618 | # Example: Hide nodejs version when there is no package.json and no *.js files in the current 619 | # directory, in `..`, in `../..` and so on. 620 | # 621 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' 622 | typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= 623 | 624 | # Ruby version from asdf. 625 | typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 626 | # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' 627 | # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' 628 | 629 | # Python version from asdf. 630 | typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37 631 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' 632 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' 633 | 634 | # Go version from asdf. 635 | typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37 636 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' 637 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' 638 | 639 | # Node.js version from asdf. 640 | typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70 641 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' 642 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' 643 | 644 | # Rust version from asdf. 645 | typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37 646 | # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' 647 | # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' 648 | 649 | # .NET Core version from asdf. 650 | typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 651 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' 652 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_SHOW_ON_UPGLOB='*.foo|*.bar' 653 | 654 | # Flutter version from asdf. 655 | typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 656 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' 657 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' 658 | 659 | # Lua version from asdf. 660 | typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32 661 | # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' 662 | # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' 663 | 664 | # Java version from asdf. 665 | typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32 666 | # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' 667 | # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' 668 | 669 | # Perl version from asdf. 670 | typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 671 | # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' 672 | # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' 673 | 674 | # Erlang version from asdf. 675 | typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125 676 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' 677 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' 678 | 679 | # Elixir version from asdf. 680 | typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129 681 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' 682 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' 683 | 684 | # Postgres version from asdf. 685 | typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31 686 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' 687 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' 688 | 689 | # PHP version from asdf. 690 | typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99 691 | # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' 692 | # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' 693 | 694 | # Haskell version from asdf. 695 | typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172 696 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 697 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' 698 | 699 | # Julia version from asdf. 700 | typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70 701 | # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' 702 | # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' 703 | 704 | ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### 705 | # NordVPN connection indicator color. 706 | typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 707 | # Hide NordVPN connection indicator when not connected. 708 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= 709 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= 710 | # Custom icon. 711 | # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' 712 | 713 | #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## 714 | # Ranger shell color. 715 | typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 716 | # Custom icon. 717 | # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' 718 | 719 | ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### 720 | # Nnn shell color. 721 | typeset -g POWERLEVEL9K_NNN_FOREGROUND=72 722 | # Custom icon. 723 | # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' 724 | 725 | ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## 726 | # xplr shell color. 727 | typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 728 | # Custom icon. 729 | # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' 730 | 731 | ###########################[ vim_shell: vim shell indicator (:sh) ]########################### 732 | # Vim shell indicator color. 733 | typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 734 | # Custom icon. 735 | # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 736 | 737 | ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### 738 | # Midnight Commander shell color. 739 | typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178 740 | # Custom icon. 741 | # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' 742 | 743 | #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## 744 | # Nix shell color. 745 | typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 746 | 747 | # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. 748 | # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= 749 | 750 | # Custom icon. 751 | # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 752 | 753 | ##################################[ disk_usage: disk usage ]################################## 754 | # Colors for different levels of disk usage. 755 | typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 756 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=220 757 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=160 758 | # Thresholds for different levels of disk usage (percentage points). 759 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 760 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 761 | # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. 762 | typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false 763 | # Custom icon. 764 | # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' 765 | 766 | ######################################[ ram: free RAM ]####################################### 767 | # RAM color. 768 | typeset -g POWERLEVEL9K_RAM_FOREGROUND=66 769 | # Custom icon. 770 | # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' 771 | 772 | #####################################[ swap: used swap ]###################################### 773 | # Swap color. 774 | typeset -g POWERLEVEL9K_SWAP_FOREGROUND=96 775 | # Custom icon. 776 | # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' 777 | 778 | ######################################[ load: CPU load ]###################################### 779 | # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. 780 | typeset -g POWERLEVEL9K_LOAD_WHICH=5 781 | # Load color when load is under 50%. 782 | typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66 783 | # Load color when load is between 50% and 70%. 784 | typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178 785 | # Load color when load is over 70%. 786 | typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166 787 | # Custom icon. 788 | # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' 789 | 790 | ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ 791 | # Todo color. 792 | typeset -g POWERLEVEL9K_TODO_FOREGROUND=110 793 | # Hide todo when the total number of tasks is zero. 794 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true 795 | # Hide todo when the number of tasks after filtering is zero. 796 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false 797 | 798 | # Todo format. The following parameters are available within the expansion. 799 | # 800 | # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. 801 | # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. 802 | # 803 | # These variables correspond to the last line of the output of `todo.sh -p ls`: 804 | # 805 | # TODO: 24 of 42 tasks shown 806 | # 807 | # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. 808 | # 809 | # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' 810 | 811 | # Custom icon. 812 | # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' 813 | 814 | ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ 815 | # Timewarrior color. 816 | typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=110 817 | # If the tracked task is longer than 24 characters, truncate and append "…". 818 | # Tip: To always display tasks without truncation, delete the following parameter. 819 | # Tip: To hide task names and display just the icon when time tracking is enabled, set the 820 | # value of the following parameter to "". 821 | typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' 822 | 823 | # Custom icon. 824 | # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' 825 | 826 | ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## 827 | # Taskwarrior color. 828 | typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74 829 | 830 | # Taskwarrior segment format. The following parameters are available within the expansion. 831 | # 832 | # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. 833 | # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. 834 | # 835 | # Zero values are represented as empty parameters. 836 | # 837 | # The default format: 838 | # 839 | # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' 840 | # 841 | # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' 842 | 843 | # Custom icon. 844 | # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' 845 | 846 | ##################################[ context: user@hostname ]################################## 847 | # Context color when running with privileges. 848 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178 849 | # Context color in SSH without privileges. 850 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180 851 | # Default context color (no privileges, no SSH). 852 | typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180 853 | 854 | # Context format when running with privileges: bold user@hostname. 855 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' 856 | # Context format when in SSH without privileges: user@hostname. 857 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' 858 | # Default context format (no privileges, no SSH): user@hostname. 859 | typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' 860 | 861 | # Don't show context unless running with privileges or in SSH. 862 | # Tip: Remove the next line to always show context. 863 | typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= 864 | 865 | # Custom icon. 866 | # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' 867 | # Custom prefix. 868 | typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' 869 | 870 | ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### 871 | # Python virtual environment color. 872 | typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 873 | # Don't show Python version next to the virtual environment name. 874 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false 875 | # If set to "false", won't show virtualenv if pyenv is already shown. 876 | # If set to "if-different", won't show virtualenv if it's the same as pyenv. 877 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false 878 | # Separate environment name from Python version only with a space. 879 | typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= 880 | # Custom icon. 881 | # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 882 | 883 | #####################[ anaconda: conda environment (https://conda.io/) ]###################### 884 | # Anaconda environment color. 885 | typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37 886 | 887 | # Anaconda segment format. The following parameters are available within the expansion. 888 | # 889 | # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. 890 | # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. 891 | # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). 892 | # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). 893 | # 894 | # CONDA_PROMPT_MODIFIER can be configured with the following command: 895 | # 896 | # conda config --set env_prompt '({default_env}) ' 897 | # 898 | # The last argument is a Python format string that can use the following variables: 899 | # 900 | # - prefix The same as CONDA_PREFIX. 901 | # - default_env The same as CONDA_DEFAULT_ENV. 902 | # - name The last segment of CONDA_PREFIX. 903 | # - stacked_env Comma-separated list of names in the environment stack. The first element is 904 | # always the same as default_env. 905 | # 906 | # Note: '({default_env}) ' is the default value of env_prompt. 907 | # 908 | # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER 909 | # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former 910 | # is empty. 911 | typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' 912 | 913 | # Custom icon. 914 | # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' 915 | 916 | ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ 917 | # Pyenv color. 918 | typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37 919 | # Hide python version if it doesn't come from one of these sources. 920 | typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) 921 | # If set to false, hide python version if it's the same as global: 922 | # $(pyenv version-name) == $(pyenv global). 923 | typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false 924 | # If set to false, hide python version if it's equal to "system". 925 | typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true 926 | 927 | # Pyenv segment format. The following parameters are available within the expansion. 928 | # 929 | # - P9K_CONTENT Current pyenv environment (pyenv version-name). 930 | # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). 931 | # 932 | # The default format has the following logic: 933 | # 934 | # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or 935 | # starts with "$P9K_PYENV_PYTHON_VERSION/". 936 | # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". 937 | typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' 938 | 939 | # Custom icon. 940 | # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 941 | 942 | ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ 943 | # Goenv color. 944 | typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37 945 | # Hide go version if it doesn't come from one of these sources. 946 | typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) 947 | # If set to false, hide go version if it's the same as global: 948 | # $(goenv version-name) == $(goenv global). 949 | typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false 950 | # If set to false, hide go version if it's equal to "system". 951 | typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true 952 | # Custom icon. 953 | # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 954 | 955 | ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## 956 | # Nodenv color. 957 | typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70 958 | # Hide node version if it doesn't come from one of these sources. 959 | typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) 960 | # If set to false, hide node version if it's the same as global: 961 | # $(nodenv version-name) == $(nodenv global). 962 | typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false 963 | # If set to false, hide node version if it's equal to "system". 964 | typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true 965 | # Custom icon. 966 | # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 967 | 968 | ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### 969 | # Nvm color. 970 | typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 971 | # Custom icon. 972 | # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 973 | 974 | ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ 975 | # Nodeenv color. 976 | typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70 977 | # Don't show Node version next to the environment name. 978 | typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false 979 | # Separate environment name from Node version only with a space. 980 | typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= 981 | # Custom icon. 982 | # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 983 | 984 | ##############################[ node_version: node.js version ]############################### 985 | # Node version color. 986 | typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70 987 | # Show node version only when in a directory tree containing package.json. 988 | typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true 989 | # Custom icon. 990 | # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 991 | 992 | #######################[ go_version: go version (https://golang.org) ]######################## 993 | # Go version color. 994 | typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37 995 | # Show go version only when in a go project subdirectory. 996 | typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true 997 | # Custom icon. 998 | # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 999 | 1000 | #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## 1001 | # Rust version color. 1002 | typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37 1003 | # Show rust version only when in a rust project subdirectory. 1004 | typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true 1005 | # Custom icon. 1006 | # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1007 | 1008 | ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ 1009 | # .NET version color. 1010 | typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134 1011 | # Show .NET version only when in a .NET project subdirectory. 1012 | typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true 1013 | # Custom icon. 1014 | # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1015 | 1016 | #####################[ php_version: php version (https://www.php.net/) ]###################### 1017 | # PHP version color. 1018 | typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99 1019 | # Show PHP version only when in a PHP project subdirectory. 1020 | typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true 1021 | # Custom icon. 1022 | # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1023 | 1024 | ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### 1025 | # Laravel version color. 1026 | typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161 1027 | # Custom icon. 1028 | # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1029 | 1030 | ####################[ java_version: java version (https://www.java.com/) ]#################### 1031 | # Java version color. 1032 | typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32 1033 | # Show java version only when in a java project subdirectory. 1034 | typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true 1035 | # Show brief version. 1036 | typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false 1037 | # Custom icon. 1038 | # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1039 | 1040 | ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### 1041 | # Package color. 1042 | typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117 1043 | # Package format. The following parameters are available within the expansion. 1044 | # 1045 | # - P9K_PACKAGE_NAME The value of `name` field in package.json. 1046 | # - P9K_PACKAGE_VERSION The value of `version` field in package.json. 1047 | # 1048 | # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' 1049 | # Custom icon. 1050 | # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1051 | 1052 | #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## 1053 | # Rbenv color. 1054 | typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168 1055 | # Hide ruby version if it doesn't come from one of these sources. 1056 | typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) 1057 | # If set to false, hide ruby version if it's the same as global: 1058 | # $(rbenv version-name) == $(rbenv global). 1059 | typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false 1060 | # If set to false, hide ruby version if it's equal to "system". 1061 | typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true 1062 | # Custom icon. 1063 | # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1064 | 1065 | #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## 1066 | # Rvm color. 1067 | typeset -g POWERLEVEL9K_RVM_FOREGROUND=168 1068 | # Don't show @gemset at the end. 1069 | typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false 1070 | # Don't show ruby- at the front. 1071 | typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false 1072 | # Custom icon. 1073 | # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 1074 | 1075 | ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ 1076 | # Fvm color. 1077 | typeset -g POWERLEVEL9K_FVM_FOREGROUND=38 1078 | # Custom icon. 1079 | # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 1080 | 1081 | ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### 1082 | # Lua color. 1083 | typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32 1084 | # Hide lua version if it doesn't come from one of these sources. 1085 | typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) 1086 | # If set to false, hide lua version if it's the same as global: 1087 | # $(luaenv version-name) == $(luaenv global). 1088 | typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false 1089 | # If set to false, hide lua version if it's equal to "system". 1090 | typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true 1091 | # Custom icon. 1092 | # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1093 | 1094 | ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ 1095 | # Java color. 1096 | typeset -g POWERLEVEL9K_JENV_FOREGROUND=32 1097 | # Hide java version if it doesn't come from one of these sources. 1098 | typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) 1099 | # If set to false, hide java version if it's the same as global: 1100 | # $(jenv version-name) == $(jenv global). 1101 | typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false 1102 | # If set to false, hide java version if it's equal to "system". 1103 | typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true 1104 | # Custom icon. 1105 | # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1106 | 1107 | ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ 1108 | # Perl color. 1109 | typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67 1110 | # Hide perl version if it doesn't come from one of these sources. 1111 | typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) 1112 | # If set to false, hide perl version if it's the same as global: 1113 | # $(plenv version-name) == $(plenv global). 1114 | typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false 1115 | # If set to false, hide perl version if it's equal to "system". 1116 | typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true 1117 | # Custom icon. 1118 | # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1119 | 1120 | ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ 1121 | # PHP color. 1122 | typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 1123 | # Hide php version if it doesn't come from one of these sources. 1124 | typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) 1125 | # If set to false, hide php version if it's the same as global: 1126 | # $(phpenv version-name) == $(phpenv global). 1127 | typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false 1128 | # If set to false, hide php version if it's equal to "system". 1129 | typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true 1130 | # Custom icon. 1131 | # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1132 | 1133 | #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### 1134 | # Scala color. 1135 | typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 1136 | # Hide scala version if it doesn't come from one of these sources. 1137 | typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) 1138 | # If set to false, hide scala version if it's the same as global: 1139 | # $(scalaenv version-name) == $(scalaenv global). 1140 | typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false 1141 | # If set to false, hide scala version if it's equal to "system". 1142 | typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true 1143 | # Custom icon. 1144 | # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1145 | 1146 | ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### 1147 | # Haskell color. 1148 | typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 1149 | # Hide haskell version if it doesn't come from one of these sources. 1150 | # 1151 | # shell: version is set by STACK_YAML 1152 | # local: version is set by stack.yaml up the directory tree 1153 | # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) 1154 | typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) 1155 | # If set to false, hide haskell version if it's the same as in the implicit global project. 1156 | typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true 1157 | # Custom icon. 1158 | # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' 1159 | 1160 | #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# 1161 | # Show kubecontext only when the command you are typing invokes one of these tools. 1162 | # Tip: Remove the next line to always show kubecontext. 1163 | typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' 1164 | 1165 | # Kubernetes context classes for the purpose of using different colors, icons and expansions with 1166 | # different contexts. 1167 | # 1168 | # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element 1169 | # in each pair defines a pattern against which the current kubernetes context gets matched. 1170 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1171 | # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, 1172 | # you'll see this value in your prompt. The second element of each pair in 1173 | # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The 1174 | # first match wins. 1175 | # 1176 | # For example, given these settings: 1177 | # 1178 | # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( 1179 | # '*prod*' PROD 1180 | # '*test*' TEST 1181 | # '*' DEFAULT) 1182 | # 1183 | # If your current kubernetes context is "deathray-testing/default", its class is TEST 1184 | # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. 1185 | # 1186 | # You can define different colors, icons and content expansions for different classes: 1187 | # 1188 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=28 1189 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1190 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1191 | typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( 1192 | # '*prod*' PROD # These values are examples that are unlikely 1193 | # '*test*' TEST # to match your needs. Customize them as needed. 1194 | '*' DEFAULT) 1195 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134 1196 | # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1197 | 1198 | # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext 1199 | # segment. Parameter expansions are very flexible and fast, too. See reference: 1200 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. 1201 | # 1202 | # Within the expansion the following parameters are always available: 1203 | # 1204 | # - P9K_CONTENT The content that would've been displayed if there was no content 1205 | # expansion defined. 1206 | # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the 1207 | # output of `kubectl config get-contexts`. 1208 | # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the 1209 | # output of `kubectl config get-contexts`. 1210 | # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE 1211 | # in the output of `kubectl config get-contexts`. If there is no 1212 | # namespace, the parameter is set to "default". 1213 | # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the 1214 | # output of `kubectl config get-contexts`. 1215 | # 1216 | # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), 1217 | # the following extra parameters are available: 1218 | # 1219 | # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". 1220 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. 1221 | # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. 1222 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. 1223 | # 1224 | # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, 1225 | # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": 1226 | # 1227 | # - P9K_KUBECONTEXT_CLOUD_NAME=gke 1228 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account 1229 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a 1230 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 1231 | # 1232 | # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": 1233 | # 1234 | # - P9K_KUBECONTEXT_CLOUD_NAME=eks 1235 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 1236 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 1237 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 1238 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= 1239 | # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. 1240 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' 1241 | # Append the current context's namespace if it's not "default". 1242 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' 1243 | 1244 | # Custom prefix. 1245 | typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' 1246 | 1247 | ################[ terraform: terraform workspace (https://www.terraform.io) ]################# 1248 | # Don't show terraform workspace if it's literally "default". 1249 | typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false 1250 | # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element 1251 | # in each pair defines a pattern against which the current terraform workspace gets matched. 1252 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1253 | # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, 1254 | # you'll see this value in your prompt. The second element of each pair in 1255 | # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The 1256 | # first match wins. 1257 | # 1258 | # For example, given these settings: 1259 | # 1260 | # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( 1261 | # '*prod*' PROD 1262 | # '*test*' TEST 1263 | # '*' OTHER) 1264 | # 1265 | # If your current terraform workspace is "project_test", its class is TEST because "project_test" 1266 | # doesn't match the pattern '*prod*' but does match '*test*'. 1267 | # 1268 | # You can define different colors, icons and content expansions for different classes: 1269 | # 1270 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28 1271 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1272 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1273 | typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( 1274 | # '*prod*' PROD # These values are examples that are unlikely 1275 | # '*test*' TEST # to match your needs. Customize them as needed. 1276 | '*' OTHER) 1277 | typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 1278 | # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' 1279 | 1280 | #############[ terraform_version: terraform version (https://www.terraform.io) ]############## 1281 | # Terraform version color. 1282 | typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 1283 | # Custom icon. 1284 | # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1285 | 1286 | #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# 1287 | # Show aws only when the command you are typing invokes one of these tools. 1288 | # Tip: Remove the next line to always show aws. 1289 | typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' 1290 | 1291 | # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element 1292 | # in each pair defines a pattern against which the current AWS profile gets matched. 1293 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1294 | # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, 1295 | # you'll see this value in your prompt. The second element of each pair in 1296 | # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The 1297 | # first match wins. 1298 | # 1299 | # For example, given these settings: 1300 | # 1301 | # typeset -g POWERLEVEL9K_AWS_CLASSES=( 1302 | # '*prod*' PROD 1303 | # '*test*' TEST 1304 | # '*' DEFAULT) 1305 | # 1306 | # If your current AWS profile is "company_test", its class is TEST 1307 | # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. 1308 | # 1309 | # You can define different colors, icons and content expansions for different classes: 1310 | # 1311 | # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 1312 | # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1313 | # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1314 | typeset -g POWERLEVEL9K_AWS_CLASSES=( 1315 | # '*prod*' PROD # These values are examples that are unlikely 1316 | # '*test*' TEST # to match your needs. Customize them as needed. 1317 | '*' DEFAULT) 1318 | typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208 1319 | # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1320 | 1321 | # AWS segment format. The following parameters are available within the expansion. 1322 | # 1323 | # - P9K_AWS_PROFILE The name of the current AWS profile. 1324 | # - P9K_AWS_REGION The region associated with the current AWS profile. 1325 | typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' 1326 | 1327 | #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# 1328 | # AWS Elastic Beanstalk environment color. 1329 | typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 1330 | # Custom icon. 1331 | # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1332 | 1333 | ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## 1334 | # Show azure only when the command you are typing invokes one of these tools. 1335 | # Tip: Remove the next line to always show azure. 1336 | typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' 1337 | # Azure account name color. 1338 | typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 1339 | # Custom icon. 1340 | # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1341 | 1342 | ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### 1343 | # Show gcloud only when the command you are typing invokes one of these tools. 1344 | # Tip: Remove the next line to always show gcloud. 1345 | typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' 1346 | # Google cloud color. 1347 | typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32 1348 | 1349 | # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or 1350 | # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative 1351 | # enough. You can use the following parameters in the expansions. Each of them corresponds to the 1352 | # output of `gcloud` tool. 1353 | # 1354 | # Parameter | Source 1355 | # -------------------------|-------------------------------------------------------------------- 1356 | # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' 1357 | # P9K_GCLOUD_ACCOUNT | gcloud config get-value account 1358 | # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project 1359 | # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' 1360 | # 1361 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. 1362 | # 1363 | # Obtaining project name requires sending a request to Google servers. This can take a long time 1364 | # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud 1365 | # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets 1366 | # set and gcloud prompt segment transitions to state COMPLETE. 1367 | # 1368 | # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL 1369 | # and COMPLETE. You can also hide gcloud in state PARTIAL by setting 1370 | # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and 1371 | # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. 1372 | typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' 1373 | typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' 1374 | 1375 | # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name 1376 | # this often. Negative value disables periodic polling. In this mode project name is retrieved 1377 | # only when the current configuration, account or project id changes. 1378 | typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 1379 | 1380 | # Custom icon. 1381 | # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' 1382 | 1383 | #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# 1384 | # Show google_app_cred only when the command you are typing invokes one of these tools. 1385 | # Tip: Remove the next line to always show google_app_cred. 1386 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' 1387 | 1388 | # Google application credentials classes for the purpose of using different colors, icons and 1389 | # expansions with different credentials. 1390 | # 1391 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first 1392 | # element in each pair defines a pattern against which the current kubernetes context gets 1393 | # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion 1394 | # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION 1395 | # parameters, you'll see this value in your prompt. The second element of each pair in 1396 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. 1397 | # The first match wins. 1398 | # 1399 | # For example, given these settings: 1400 | # 1401 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( 1402 | # '*:*prod*:*' PROD 1403 | # '*:*test*:*' TEST 1404 | # '*' DEFAULT) 1405 | # 1406 | # If your current Google application credentials is "service_account deathray-testing x@y.com", 1407 | # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. 1408 | # 1409 | # You can define different colors, icons and content expansions for different classes: 1410 | # 1411 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 1412 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1413 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' 1414 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( 1415 | # '*:*prod*:*' PROD # These values are examples that are unlikely 1416 | # '*:*test*:*' TEST # to match your needs. Customize them as needed. 1417 | '*' DEFAULT) 1418 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=32 1419 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1420 | 1421 | # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by 1422 | # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: 1423 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. 1424 | # 1425 | # You can use the following parameters in the expansion. Each of them corresponds to one of the 1426 | # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. 1427 | # 1428 | # Parameter | JSON key file field 1429 | # ---------------------------------+--------------- 1430 | # P9K_GOOGLE_APP_CRED_TYPE | type 1431 | # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id 1432 | # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email 1433 | # 1434 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. 1435 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' 1436 | 1437 | ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### 1438 | # Toolbox color. 1439 | typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178 1440 | # Don't display the name of the toolbox if it matches fedora-toolbox-*. 1441 | typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' 1442 | # Custom icon. 1443 | # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' 1444 | # Custom prefix. 1445 | typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' 1446 | 1447 | ###############################[ public_ip: public IP address ]############################### 1448 | # Public IP color. 1449 | typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94 1450 | # Custom icon. 1451 | # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1452 | 1453 | ########################[ vpn_ip: virtual private network indicator ]######################### 1454 | # VPN IP color. 1455 | typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=81 1456 | # When on VPN, show just an icon without the IP address. 1457 | # Tip: To display the private IP address when on VPN, remove the next line. 1458 | typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= 1459 | # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN 1460 | # to see the name of the interface. 1461 | typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' 1462 | # If set to true, show one segment per matching network interface. If set to false, show only 1463 | # one segment corresponding to the first matching network interface. 1464 | # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. 1465 | typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false 1466 | # Custom icon. 1467 | # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1468 | 1469 | ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### 1470 | # IP color. 1471 | typeset -g POWERLEVEL9K_IP_FOREGROUND=38 1472 | # The following parameters are accessible within the expansion: 1473 | # 1474 | # Parameter | Meaning 1475 | # ----------------------+------------------------------------------- 1476 | # P9K_IP_IP | IP address 1477 | # P9K_IP_INTERFACE | network interface 1478 | # P9K_IP_RX_BYTES | total number of bytes received 1479 | # P9K_IP_TX_BYTES | total number of bytes sent 1480 | # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt 1481 | # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt 1482 | # P9K_IP_RX_RATE | receive rate (since last prompt) 1483 | # P9K_IP_TX_RATE | send rate (since last prompt) 1484 | 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}' 1485 | # Show information for the first network interface whose name matches this regular expression. 1486 | # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. 1487 | typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' 1488 | # Custom icon. 1489 | # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1490 | 1491 | #########################[ proxy: system-wide http/https/ftp proxy ]########################## 1492 | # Proxy color. 1493 | typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68 1494 | # Custom icon. 1495 | # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' 1496 | 1497 | ################################[ battery: internal battery ]################################# 1498 | # Show battery in red when it's below this level and not connected to power supply. 1499 | typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 1500 | typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160 1501 | # Show battery in green when it's charging or fully charged. 1502 | typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=70 1503 | # Show battery in yellow when it's discharging. 1504 | typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178 1505 | # Battery pictograms going from low to high level of charge. 1506 | typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' 1507 | # Don't show the remaining time to charge/discharge. 1508 | typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false 1509 | 1510 | #####################################[ wifi: wifi speed ]##################################### 1511 | # WiFi color. 1512 | typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68 1513 | # Custom icon. 1514 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' 1515 | 1516 | # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). 1517 | # 1518 | # # Wifi colors and icons for different signal strength levels (low to high). 1519 | # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values 1520 | # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values 1521 | # 1522 | # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' 1523 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' 1524 | # 1525 | # The following parameters are accessible within the expansions: 1526 | # 1527 | # Parameter | Meaning 1528 | # ----------------------+--------------- 1529 | # P9K_WIFI_SSID | service set identifier, a.k.a. network name 1530 | # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown 1531 | # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second 1532 | # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 1533 | # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 1534 | # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) 1535 | 1536 | ####################################[ time: current time ]#################################### 1537 | # Current time color. 1538 | typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 1539 | # Format for the current time: 09:51:02. See `man 3 strftime`. 1540 | typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' 1541 | # If set to true, time will update when you hit enter. This way prompts for the past 1542 | # commands will contain the start times of their commands as opposed to the default 1543 | # behavior where they contain the end times of their preceding commands. 1544 | typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false 1545 | # Custom icon. 1546 | # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' 1547 | # Custom prefix. 1548 | typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' 1549 | 1550 | # Example of a user-defined prompt segment. Function prompt_example will be called on every 1551 | # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or 1552 | # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user. 1553 | # 1554 | # Type `p10k help segment` for documentation and a more sophisticated example. 1555 | function prompt_example() { 1556 | p10k segment -f 208 -i '⭐' -t 'hello, %n' 1557 | } 1558 | 1559 | # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job 1560 | # is to generate the prompt segment for display in instant prompt. See 1561 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. 1562 | # 1563 | # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function 1564 | # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k 1565 | # will replay these calls without actually calling instant_prompt_*. It is imperative that 1566 | # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this 1567 | # rule is not observed, the content of instant prompt will be incorrect. 1568 | # 1569 | # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If 1570 | # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. 1571 | function instant_prompt_example() { 1572 | # Since prompt_example always makes the same `p10k segment` calls, we can call it from 1573 | # instant_prompt_example. This will give us the same `example` prompt segment in the instant 1574 | # and regular prompts. 1575 | prompt_example 1576 | } 1577 | 1578 | # User-defined prompt segments can be customized the same way as built-in segments. 1579 | # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 1580 | # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1581 | 1582 | # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt 1583 | # when accepting a command line. Supported values: 1584 | # 1585 | # - off: Don't change prompt when accepting a command line. 1586 | # - always: Trim down prompt when accepting a command line. 1587 | # - same-dir: Trim down prompt when accepting a command line unless this is the first command 1588 | # typed after changing current working directory. 1589 | typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off 1590 | 1591 | # Instant prompt mode. 1592 | # 1593 | # - off: Disable instant prompt. Choose this if you've tried instant prompt and found 1594 | # it incompatible with your zsh configuration files. 1595 | # - quiet: Enable instant prompt and don't print warnings when detecting console output 1596 | # during zsh initialization. Choose this if you've read and understood 1597 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. 1598 | # - verbose: Enable instant prompt and print a warning when detecting console output during 1599 | # zsh initialization. Choose this if you've never tried instant prompt, haven't 1600 | # seen the warning, or if you are unsure what this all means. 1601 | typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet 1602 | 1603 | # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. 1604 | # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload 1605 | # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you 1606 | # really need it. 1607 | typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true 1608 | 1609 | # If p10k is already loaded, reload configuration. 1610 | # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. 1611 | (( ! $+functions[p10k] )) || p10k reload 1612 | } 1613 | 1614 | # Tell `p10k configure` which file it should overwrite. 1615 | typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} 1616 | 1617 | (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} 1618 | 'builtin' 'unset' 'p10k_config_opts' 1619 | -------------------------------------------------------------------------------- /docker/8.2/.zshrc: -------------------------------------------------------------------------------- 1 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 2 | # Initialization code that may require console input (password prompts, [y/n] 3 | # confirmations, etc.) must go above this block; everything else may go below. 4 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 5 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 6 | fi 7 | 8 | # If you come from bash you might have to change your $PATH. 9 | # export PATH=$HOME/bin:/usr/local/bin:$PATH 10 | 11 | # Path to your oh-my-zsh installation. 12 | export ZSH="/home/sail/.oh-my-zsh" 13 | export NODE_OPTIONS=--max_old_space_size=3072 14 | export GPG_TTY=$(tty) 15 | 16 | # Set name of the theme to load --- if set to "random", it will 17 | # load a random theme each time oh-my-zsh is loaded, in which case, 18 | # to know which specific one was loaded, run: echo $RANDOM_THEME 19 | # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 20 | ZSH_THEME="powerlevel10k/powerlevel10k" 21 | 22 | # Set list of themes to pick from when loading at random 23 | # Setting this variable when ZSH_THEME=random will cause zsh to load 24 | # a theme from this variable instead of looking in $ZSH/themes/ 25 | # If set to an empty array, this variable will have no effect. 26 | # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) 27 | 28 | # Uncomment the following line to use case-sensitive completion. 29 | # CASE_SENSITIVE="true" 30 | 31 | # Uncomment the following line to use hyphen-insensitive completion. 32 | # Case-sensitive completion must be off. _ and - will be interchangeable. 33 | # HYPHEN_INSENSITIVE="true" 34 | 35 | # Uncomment the following line to disable bi-weekly auto-update checks. 36 | # DISABLE_AUTO_UPDATE="true" 37 | 38 | # Uncomment the following line to automatically update without prompting. 39 | # DISABLE_UPDATE_PROMPT="true" 40 | 41 | # Uncomment the following line to change how often to auto-update (in days). 42 | # export UPDATE_ZSH_DAYS=13 43 | 44 | # Uncomment the following line if pasting URLs and other text is messed up. 45 | # DISABLE_MAGIC_FUNCTIONS="true" 46 | 47 | # Uncomment the following line to disable colors in ls. 48 | # DISABLE_LS_COLORS="true" 49 | 50 | # Uncomment the following line to disable auto-setting terminal title. 51 | # DISABLE_AUTO_TITLE="true" 52 | 53 | # Uncomment the following line to enable command auto-correction. 54 | # ENABLE_CORRECTION="true" 55 | 56 | # Uncomment the following line to display red dots whilst waiting for completion. 57 | # COMPLETION_WAITING_DOTS="true" 58 | 59 | # Uncomment the following line if you want to disable marking untracked files 60 | # under VCS as dirty. This makes repository status check for large repositories 61 | # much, much faster. 62 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 63 | 64 | # Uncomment the following line if you want to change the command execution time 65 | # stamp shown in the history command output. 66 | # You can set one of the optional three formats: 67 | # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 68 | # or set a custom format using the strftime function format specifications, 69 | # see 'man strftime' for details. 70 | # HIST_STAMPS="mm/dd/yyyy" 71 | 72 | # Would you like to use another custom folder than $ZSH/custom? 73 | # ZSH_CUSTOM=/path/to/new-custom-folder 74 | 75 | # Which plugins would you like to load? 76 | # Standard plugins can be found in $ZSH/plugins/ 77 | # Custom plugins may be added to $ZSH_CUSTOM/plugins/ 78 | # Example format: plugins=(rails git textmate ruby lighthouse) 79 | # Add wisely, as too many plugins slow down shell startup. 80 | plugins=(git you-should-use zsh-autosuggestions zsh-syntax-highlighting) 81 | 82 | fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src 83 | source $ZSH/oh-my-zsh.sh 84 | 85 | # User configuration 86 | 87 | # export MANPATH="/usr/local/man:$MANPATH" 88 | 89 | # You may need to manually set your language environment 90 | # export LANG=en_US.UTF-8 91 | 92 | # Preferred editor for local and remote sessions 93 | # if [[ -n $SSH_CONNECTION ]]; then 94 | # export EDITOR='vim' 95 | # else 96 | # export EDITOR='mvim' 97 | # fi 98 | 99 | # Compilation flags 100 | # export ARCHFLAGS="-arch x86_64" 101 | 102 | # Set personal aliases, overriding those provided by oh-my-zsh libs, 103 | # plugins, and themes. Aliases can be placed here, though oh-my-zsh 104 | # users are encouraged to define aliases within the ZSH_CUSTOM folder. 105 | # For a full list of active aliases, run `alias`. 106 | # 107 | # Example aliases 108 | alias zshconfig="mate ~/.zshrc" 109 | alias ohmyzsh="mate ~/.oh-my-zsh" 110 | alias pa="php -d memory_limit=-1 artisan" 111 | alias pat="php artisan test --parallel --stop-on-failure" 112 | alias phpunit="./vendor/bin/phpunit -d memory_limit=-1" 113 | alias ll="ls -la" 114 | alias gc="git checkout" 115 | alias gpo="git push origin" 116 | alias gm="git merge" 117 | alias glog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" 118 | alias nah='git reset HEAD --hard; git clean -df' 119 | alias composer="COMPOSER_MEMORY_LIMIT=-1 composer" 120 | alias cu="composer update" 121 | alias cr="composer require" 122 | alias ci="composer install" 123 | alias cda="composer dump-autoload -o" 124 | 125 | fpath=($fpath "/home/sail/.zfunctions") 126 | 127 | 128 | 129 | 130 | 131 | # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. 132 | [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh 133 | (( ! ${+functions[p10k]} )) || p10k finalize 134 | 135 | export GPG_TTY=$(tty) 136 | -------------------------------------------------------------------------------- /docker/8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | LABEL maintainer="Taylor Otwell" 4 | 5 | ARG WWWGROUP 6 | ARG NODE_VERSION=18 7 | ARG POSTGRES_VERSION=14 8 | 9 | WORKDIR /var/www/html 10 | 11 | ENV DEBIAN_FRONTEND noninteractive 12 | ENV TZ=UTC 13 | 14 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 15 | 16 | RUN apt-get update \ 17 | && apt-get install -y sudo nala zsh nano gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \ 18 | && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null \ 19 | && echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ 20 | && apt-get update \ 21 | && apt-get install -y php8.2-cli php8.2-dev \ 22 | php8.2-pgsql php8.2-sqlite3 php8.2-gd \ 23 | php8.2-curl \ 24 | php8.2-imap php8.2-mysql php8.2-mbstring \ 25 | php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap \ 26 | php8.2-intl php8.2-readline \ 27 | php8.2-ldap \ 28 | php8.2-msgpack php8.2-igbinary php8.2-redis php8.2-swoole \ 29 | php8.2-memcached php8.2-pcov php8.2-xdebug \ 30 | && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \ 31 | && curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ 32 | && apt-get install -y nodejs \ 33 | && npm install -g npm \ 34 | && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarn.gpg >/dev/null \ 35 | && echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ 36 | && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null \ 37 | && echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ 38 | && apt-get update \ 39 | && apt-get install -y yarn \ 40 | && apt-get install -y mysql-client \ 41 | && apt-get install -y postgresql-client-$POSTGRES_VERSION \ 42 | && apt-get -y autoremove \ 43 | && apt-get clean \ 44 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 45 | 46 | RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2 47 | 48 | RUN groupadd --force -g $WWWGROUP sail 49 | 50 | # customizations 51 | ## configure passwordless sudo 52 | RUN useradd -ms /bin/zsh --no-user-group -g $WWWGROUP -u 1337 sail 53 | RUN adduser sail sudo 54 | RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 55 | 56 | ## set up oh-my-zsh 57 | USER sail 58 | RUN sh -c "$(curl -L https://github.com/deluan/zsh-in-docker/releases/download/v1.1.4/zsh-in-docker.sh)" -- \ 59 | -p git \ 60 | -p https://github.com/jessarcher/zsh-artisan \ 61 | -p https://github.com/zsh-users/zsh-autosuggestions \ 62 | -p https://github.com/MichaelAquilina/zsh-you-should-use \ 63 | -p https://github.com/zsh-users/zsh-syntax-highlighting \ 64 | -p https://github.com/zsh-users/zsh-completions 65 | RUN mv /home/sail/.oh-my-zsh/custom/plugins/zsh-you-should-use /home/sail/.oh-my-zsh/custom/plugins/you-should-use 66 | RUN mv /home/sail/.oh-my-zsh/custom/plugins/zsh-artisan /home/sail/.oh-my-zsh/custom/plugins/artisan 67 | USER root 68 | COPY .zshrc /home/sail/.zshrc 69 | COPY .p10k.zsh /home/sail/.p10k.zsh 70 | 71 | ## install git hubflow 72 | RUN cd /home/sail \ 73 | && git clone https://github.com/datasift/gitflow \ 74 | && cd gitflow \ 75 | && ./install.sh 76 | # end customizations 77 | 78 | COPY start-container /usr/local/bin/start-container 79 | COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf 80 | COPY php.ini /etc/php/8.2/cli/conf.d/99-sail.ini 81 | RUN chmod +x /usr/local/bin/start-container 82 | 83 | EXPOSE 8000 84 | 85 | ENTRYPOINT ["start-container"] 86 | -------------------------------------------------------------------------------- /docker/8.2/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | variables_order = EGPCS 5 | -------------------------------------------------------------------------------- /docker/8.2/start-container: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ ! -z "$WWWUSER" ]; then 4 | usermod -u $WWWUSER sail 5 | fi 6 | 7 | if [ ! -d /.composer ]; then 8 | mkdir /.composer 9 | fi 10 | 11 | chmod -R ugo+rw /.composer 12 | 13 | if [ $# -gt 0 ]; then 14 | exec gosu $WWWUSER "$@" 15 | else 16 | exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf 17 | fi 18 | -------------------------------------------------------------------------------- /docker/8.2/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | user=root 4 | logfile=/var/log/supervisor/supervisord.log 5 | pidfile=/var/run/supervisord.pid 6 | 7 | [program:php] 8 | command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80 9 | user=sail 10 | environment=LARAVEL_SAIL="1" 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | -------------------------------------------------------------------------------- /phive: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikebronner/php-coding-standards/226517af92088805b3924d0cb8950be69a1b3e36/phive -------------------------------------------------------------------------------- /phive.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | GeneaLabs coding standards. 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /phpmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | Custom ruleset for Laravel. 11 | 12 | 13 | docker 14 | public 15 | node_modules 16 | vendor 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 50 33 | 34 | 35 | 36 | 37 | 38 | 39 | 2 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/GeneaLabs/Sniffs/TypeHinting/MethodParameterTypeHintSniff.php: -------------------------------------------------------------------------------- 1 | file = $phpcsFile; 28 | $this->stackPointer = $stackPointer; 29 | $this->tokens = $this->file->getTokens(); 30 | $this->lintMethodSignature(); 31 | } 32 | 33 | protected function doesInterfaceParameterNotHaveTypeHint( 34 | $parameterName, 35 | $parameterIndex 36 | ): bool { 37 | $methodName = $this->file->getDeclarationName($this->stackPointer); 38 | $parameterName = trim($parameterName, "$ "); 39 | $className = $this->getFullyQualifiedClassName(); 40 | $interfaces = []; 41 | 42 | try { 43 | $reflectedClass = new ReflectionClass($className); 44 | } catch (Exception $exception) { 45 | // continue 46 | } finally { 47 | if ($reflectedClass ?? false) { 48 | $interfaces = $reflectedClass->getInterfaces(); 49 | } 50 | } 51 | 52 | foreach ($interfaces as $interface) { 53 | $reflectedInterface = new ReflectionClass($interface->name); 54 | $methods = $reflectedInterface->getMethods(); 55 | 56 | foreach ($methods as $method) { 57 | if ($method->name !== $methodName) { 58 | continue; 59 | } 60 | 61 | $reflectedMethod = new ReflectionMethod($interface->name, $method->name); 62 | $parameters = $reflectedMethod->getParameters(); 63 | 64 | foreach ($parameters as $key => $parameter) { 65 | if ($key !== $parameterIndex) { 66 | continue; 67 | } 68 | 69 | $reflectedParameter = new ReflectionParameter([$interface->name, $method->name], $key); 70 | $type = $reflectedParameter->getType(); 71 | 72 | if (! $type) { 73 | return true; 74 | } 75 | } 76 | } 77 | } 78 | 79 | return false; 80 | } 81 | 82 | protected function getFullyQualifiedClassName(): string 83 | { 84 | $classToken = $this->file->findPrevious(T_CLASS, $this->stackPointer); 85 | $className = ""; 86 | 87 | if ($classToken) { 88 | $namespaceToken = $this->file->findPrevious(T_NAMESPACE, $classToken); 89 | $namespace = ""; 90 | $index = $namespaceToken; 91 | $reachedEndOfLine = false; 92 | 93 | while (! $reachedEndOfLine) { 94 | $content = $this->tokens[$index]["content"]; 95 | $namespace .= $content; 96 | $index++; 97 | $reachedEndOfLine = $content === "\n"; 98 | } 99 | 100 | $namespace = str_replace("namespace", "", $namespace); 101 | $namespace = str_replace(";", "", $namespace); 102 | $namespace = trim($namespace); 103 | $className = $namespace . "\\" . $this->file->getDeclarationName($classToken); 104 | } 105 | 106 | return $className; 107 | } 108 | 109 | protected function getMethodLine(): string 110 | { 111 | $line = ""; 112 | $reachedEndOfLine = false; 113 | $index = $this->stackPointer; 114 | 115 | while (! $reachedEndOfLine) { 116 | $content = $this->tokens[$index]["content"]; 117 | $line .= $content; 118 | $reachedEndOfLine = $content === "\n"; 119 | $index++; 120 | } 121 | 122 | $matches = []; 123 | preg_match('/\((.*?)\)/', $line, $matches); 124 | $line = $matches[1] 125 | ?? ""; 126 | 127 | return $line; 128 | } 129 | 130 | protected function lintMethodSignature(): void 131 | { 132 | $parameters = $this->getMethodLine(); 133 | 134 | if (! $parameters) { 135 | return; 136 | } 137 | 138 | $parameters = explode(",", $parameters); 139 | 140 | $index = $this->stackPointer; 141 | 142 | foreach ($parameters as $parameterIndex => $parameter) { 143 | $parameter = trim($parameter); 144 | 145 | if ($parameter[0] === "$") { 146 | $index = $this->stackPointer; 147 | $parameter = trim(explode("=", $parameter)[0]); 148 | 149 | if (! $this->doesInterfaceParameterNotHaveTypeHint($parameter, $parameterIndex)) { 150 | while ($index < $this->tokens[$this->stackPointer]["parenthesis_closer"]) { 151 | if ($parameter == $this->tokens[$index]["content"]) { 152 | $this->file->addError( 153 | "Missing parameter type hint.", 154 | $index, 155 | "MissingParameterTypeHint" 156 | ); 157 | } 158 | 159 | $index++; 160 | } 161 | } 162 | } 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /src/GeneaLabs/Sniffs/TypeHinting/ReturnTypeSniff.php: -------------------------------------------------------------------------------- 1 | file = $phpcsFile; 24 | $this->stackPointer = $stackPointer; 25 | $this->tokens = $this->file->getTokens(); 26 | $this->lintMethodSignature(); 27 | } 28 | 29 | protected function getMethodLine(): string 30 | { 31 | $line = ""; 32 | $reachedEndOfLine = false; 33 | $index = $this->stackPointer; 34 | 35 | while (! $reachedEndOfLine) { 36 | $content = $this->tokens[$index]["content"]; 37 | $line .= $content; 38 | $reachedEndOfLine = $content === "\n"; 39 | $index++; 40 | } 41 | 42 | return $line; 43 | } 44 | 45 | protected function lintMethodSignature(): void 46 | { 47 | if ($this->file->getDeclarationName($this->stackPointer) === "__construct") { 48 | return; 49 | } 50 | 51 | if (strpos($this->getMethodLine(), ":") !== false) { 52 | $this->file->addError( 53 | "Missing return type.", 54 | $this->tokens[$this->stackPointer]["parenthesis_closer"], 55 | "MissingReturnType" 56 | ); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/GeneaLabs/Sniffs/Whitespace/EmptyLineAroundControlStructureSniff.php: -------------------------------------------------------------------------------- 1 | file = $phpcsFile; 34 | $this->stackPointer = $stackPointer; 35 | $this->tokens = $phpcsFile->getTokens(); 36 | 37 | $this->lintBeforeControlStructure(); 38 | $this->lintAfterControlStructure(); 39 | } 40 | 41 | protected function isFollowingContentPermitted($content): bool 42 | { 43 | $permittedControlStructures = [ 44 | "if" => [ 45 | "else", 46 | "elseif", 47 | ], 48 | "elseif" => [ 49 | "else", 50 | ], 51 | "try" => [ 52 | "catch", 53 | ], 54 | "catch" => [ 55 | "finally", 56 | ], 57 | ]; 58 | 59 | return in_array($content, $permittedControlStructures[$this->tokens[$this->stackPointer]["content"]] ?? []) 60 | ?? false; 61 | } 62 | 63 | protected function isPreceedingContentPermitted(): bool 64 | { 65 | $content = $this->tokens[$this->stackPointer]["content"]; 66 | $ignoredControlStructures = [ 67 | "else", 68 | "elseif", 69 | "catch", 70 | "finally", 71 | ]; 72 | 73 | return ! in_array($content, $ignoredControlStructures); 74 | } 75 | 76 | protected function lintAfterControlStructure(): void 77 | { 78 | $whitespace = ""; 79 | $index = $this->file->findNext(T_WHITESPACE, $this->tokens[$this->stackPointer]["scope_closer"]); 80 | 81 | while ($this->tokens[$index]["type"] === "T_WHITESPACE") { 82 | $whitespace .= $this->tokens[$index]["content"]; 83 | $index++; 84 | } 85 | 86 | $newlines = substr_count($whitespace, "\n"); 87 | $nextToken = $this->tokens[$index]["content"]; 88 | 89 | if ( 90 | $newlines < 2 91 | && $nextToken !== "}" 92 | && ! $this->isFollowingContentPermitted($nextToken) 93 | ) { 94 | $this->file->addWarning( 95 | "Missing empty line after control structure.", 96 | $this->tokens[$this->stackPointer]["scope_closer"], 97 | "EmptyLineAfterControlStructure" 98 | ); 99 | } 100 | 101 | if ( 102 | $newlines >= 2 103 | && $nextToken === "}" 104 | ) { 105 | $this->file->addWarning( 106 | "There should be no empty lines after control " 107 | . "structures at the end of a code block.", 108 | $this->tokens[$this->stackPointer]["scope_closer"], 109 | "NoEmptyLinesAfterControlStructureAtEndOfBlock" 110 | ); 111 | } 112 | } 113 | 114 | protected function lintBeforeControlStructure(): void 115 | { 116 | if (! $this->isPreceedingContentPermitted()) { 117 | return; 118 | } 119 | 120 | $whitespace = ""; 121 | $index = $this->stackPointer - 1; 122 | 123 | while ($this->tokens[$index]["type"] === "T_WHITESPACE") { 124 | $whitespace .= $this->tokens[$index]["content"]; 125 | $index--; 126 | } 127 | 128 | $previousContent = $this->tokens[$index]["content"]; 129 | $newlines = substr_count($previousContent . $whitespace, "\n"); 130 | 131 | if ( 132 | $newlines < 2 133 | && $previousContent !== "{" 134 | ) { 135 | $this->file->addWarning( 136 | "Missing empty line before control structure.", 137 | $this->stackPointer, 138 | "EmptyLineBeforeControlStructure" 139 | ); 140 | } 141 | 142 | if ( 143 | $newlines >= 2 144 | && $previousContent === "{" 145 | ) { 146 | $this->file->addWarning( 147 | "There should be no empty line(s) at the beginning of a block before control structure.", 148 | $this->stackPointer, 149 | "NoEmptyLineBeforeControlStructureAtBeginningOfBlock" 150 | ); 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /src/GeneaLabs/Sniffs/Whitespace/EmptyLineBeforeReturnSniff.php: -------------------------------------------------------------------------------- 1 | file = $phpcsFile; 25 | $this->stackPointer = $stackPointer; 26 | $this->tokens = $this->file->getTokens(); 27 | $this->lintBeforeReturn(); 28 | } 29 | 30 | protected function lintBeforeReturn(): void 31 | { 32 | $whitespace = ""; 33 | $index = $this->stackPointer - 1; 34 | 35 | while ($this->tokens[$index]["type"] === "T_WHITESPACE") { 36 | $whitespace .= $this->tokens[$index]["content"]; 37 | $index--; 38 | } 39 | 40 | $previousContent = $this->tokens[$index]["content"]; 41 | $newlines = substr_count($whitespace, "\n"); 42 | 43 | if ( 44 | $newlines < 2 45 | && $previousContent !== "{" 46 | ) { 47 | $this->file->addWarning( 48 | "Missing empty line before return.", 49 | $this->stackPointer, 50 | "EmptyLineBeforeReturn" 51 | ); 52 | } 53 | 54 | if ( 55 | ($newlines >= 2 56 | && $previousContent === "{") 57 | || ($newlines > 2 58 | && $previousContent !== "{") 59 | ) { 60 | $extraNewLines = $newlines - 1; 61 | $this->file->addWarning( 62 | "{$extraNewLines} extraneous empty line(s) before return at beginning of block.", 63 | $this->stackPointer, 64 | "NoEmptyLineBeforeReturnAtBeginningOfBlock" 65 | ); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/GeneaLabs/Sniffs/Whitespace/MultipleEmptyLinesSniff.php: -------------------------------------------------------------------------------- 1 | file = $phpcsFile; 24 | $this->stackPointer = $stackPointer; 25 | $this->tokens = $this->file->getTokens(); 26 | $this->lintBeforeLinebreak(); 27 | } 28 | 29 | protected function lintBeforeLinebreak(): void 30 | { 31 | if ($this->tokens[$this->stackPointer]["content"] !== "\n") { 32 | return; 33 | } 34 | 35 | $whitespace = ""; 36 | $index = $this->stackPointer - 1; 37 | 38 | while ($this->tokens[$index]["type"] === "T_WHITESPACE") { 39 | $whitespace .= $this->tokens[$index]["content"]; 40 | $index--; 41 | } 42 | 43 | $newlines = substr_count($whitespace, "\n"); 44 | 45 | if ($newlines > 1) { 46 | $this->file->addWarning( 47 | "Code should not have multiple consecutive empty lines.", 48 | $this->stackPointer, 49 | "MultipleConsecutiveEmptyLines" 50 | ); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/GeneaLabs/ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /tools/CodeSniffer.conf: -------------------------------------------------------------------------------- 1 |