diff --git a/.gitignore b/.gitignore index d26d267..920a7c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store *.backup *.bak *.log diff --git a/git/.gitconfig b/git/.gitconfig index 21ef1c7..c7807ec 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,3 +1,7 @@ +[user] + name = Anthony Axenov + email = anthonyaxenov@gmail.com + signingKey = F7CCD4EC [core] editor = nano autocrlf = input @@ -25,3 +29,4 @@ path = ~/.git_aliases.local [include] path = ~/.gitconfig.local ; use this file to store other personal settings and aliases + diff --git a/shell/.bash_aliases b/shell/.bash_aliases index 2f78125..13454c3 100644 --- a/shell/.bash_aliases +++ b/shell/.bash_aliases @@ -34,8 +34,8 @@ alias ll='ls -palFh --color=auto' alias mkdir='mkdir -pv' alias where='whereis' # zsh builtin -alias ps='ps auxf' -alias psg='ps aux | grep -v grep | grep -i -e VSZ -e' +# alias ps='ps auxf' +# alias psg='ps aux | grep -v grep | grep -i -e VSZ -e' alias wine='LANG=ru_RU.utf8 wine' alias wine64='LANG=ru_RU.utf8 wine64' diff --git a/shell/.p10k.zsh b/shell/.p10k.zsh index fb3d8ea..c02079b 100644 --- a/shell/.p10k.zsh +++ b/shell/.p10k.zsh @@ -1,8 +1,8 @@ -# Generated by Powerlevel10k configuration wizard on 2025-04-10 at 13:49 +08. -# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 24045. -# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode, -# 24h time, angled separators, sharp heads, flat tails, 2 lines, dotted, no frame, -# lightest-ornaments, sparse, many icons, concise, instant_prompt=verbose. +# Generated by Powerlevel10k configuration wizard on 2026-03-26 at 00:08 +08. +# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 57633. +# Wizard options: nerdfont-v3 + powerline, small icons, rainbow, unicode, 24h time, +# round separators, round heads, flat tails, 2 lines, dotted, no frame, light-ornaments, +# sparse, many icons, concise, instant_prompt=verbose. # Type `p10k configure` to generate another config. # # Config for Powerlevel10k with powerline prompt style with colorful background. @@ -10,7 +10,7 @@ # # Tip: Looking for a nice color? Here's a one-liner to print colormap. # - # for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done # Temporarily change options. 'builtin' 'local' '-a' 'p10k_config_opts' @@ -27,12 +27,12 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # The list of segments shown on the left. Fill it with the most important segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( # =========================[ Line #1 ]========================= - # os_icon # os identifier + os_icon # os identifier dir # current directory vcs # git status # =========================[ Line #2 ]========================= @@ -55,9 +55,9 @@ anaconda # conda environment (https://conda.io/) # pyenv # python environment (https://github.com/pyenv/pyenv) goenv # go environment (https://github.com/syndbg/goenv) - # nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) - # nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) - # nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) # node_version # node.js version # go_version # go version (https://golang.org) # rust_version # rustc version (https://www.rust-lang.org) @@ -88,11 +88,14 @@ context # user@hostname # nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) # ranger # ranger shell (https://github.com/ranger/ranger) + # yazi # yazi shell (https://github.com/sxyazi/yazi) # nnn # nnn shell (https://github.com/jarun/nnn) + # lf # lf shell (https://github.com/gokcehan/lf) # xplr # xplr shell (https://github.com/sayanarijit/xplr) - vim_shell # vim shell indicator (:sh) + # vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) # nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + # chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) # vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # load # CPU load @@ -102,6 +105,8 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) # timewarrior # timewarrior tracking status (https://timewarrior.net/) # taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator + # cpu_arch # CPU architecture time # current time # =========================[ Line #2 ]========================= # newline @@ -115,7 +120,7 @@ ) # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. - typeset -g POWERLEVEL9K_MODE=nerdfont-complete + typeset -g POWERLEVEL9K_MODE=nerdfont-v3 # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. typeset -g POWERLEVEL9K_ICON_PADDING=none @@ -156,7 +161,7 @@ if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE # ornaments defined above. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=244 + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 # Start filler from the edge of the screen if there are no left segments on the first line. typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' # End filler on the edge of the screen if there are no right segments on the first line. @@ -164,17 +169,20 @@ fi # Separator between same-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B5' # Separator between same-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B7' # Separator between different-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B4' # Separator between different-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B6' + # To remove a separator between two segments, add "_joined" to the second segment name. + # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) + # The right end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4' # The left end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6' # The left end of left prompt. typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' # The right end of right prompt. @@ -243,7 +251,8 @@ .java-version .perl-version .php-version - .tool-version + .tool-versions + .mise.toml .shorten_folder_marker .svn .terraform @@ -352,7 +361,7 @@ # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' #####################################[ vcs: git status ]###################################### - # Version control system colors. + # Version control background colors. typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 @@ -430,11 +439,17 @@ res+=" ${modified}wip" fi - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" + fi + # ⇠42 if behind the push remote. (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " @@ -743,6 +758,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 + typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 @@ -750,6 +772,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=0 + typeset -g POWERLEVEL9K_LF_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## # xplr shell color. typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 @@ -776,12 +805,22 @@ typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= # Custom icon. # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usage: disk usage ]################################## # Colors for different levels of disk usage. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 @@ -813,6 +852,8 @@ # Text and color for insert vi mode. typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + # Custom icon. + # typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################################[ ram: free RAM ]####################################### # RAM color. @@ -903,6 +944,33 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 + typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ context: user@hostname ]################################## # Context color when running with privileges. typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 @@ -1037,6 +1105,11 @@ # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -1299,13 +1372,10 @@ # Custom icon. # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. @@ -1394,7 +1464,7 @@ #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|tofu|pulumi|terragrunt' # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. @@ -1443,12 +1513,42 @@ ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. - typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|tofu|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "company_test", its class is TEST because "company_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 - typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4 # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the command you are typing invokes one of these tools. @@ -1495,7 +1595,7 @@ #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# # Show google_app_cred only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show google_app_cred. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|tofu|pulumi|terragrunt' # Google application credentials classes for the purpose of using different colors, icons and # expansions with different credentials. @@ -1574,7 +1674,7 @@ typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' # If set to true, show one segment per matching network interface. If set to false, show only # one segment corresponding to the first matching network interface. # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. @@ -1621,7 +1721,7 @@ # Show battery in yellow when it's discharging. typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + typeset -g POWERLEVEL9K_BATTERY_STAGES='\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079' # Don't show the remaining time to charge/discharge. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 @@ -1680,7 +1780,7 @@ # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k @@ -1717,7 +1817,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/shell/.profile b/shell/.profile index c16596e..76d601c 100644 --- a/shell/.profile +++ b/shell/.profile @@ -16,41 +16,78 @@ fi ### AAA ########################################## +isMac() { uname -s | grep -q "Darwin"; } +isLinux() { uname -s | grep -q "Linux"; } +addPath() { [ -d "$1" ] && export PATH="$1:$PATH"; } +safeSource() { [ -s "$1" ] && source "$1" 2>/dev/null || true; } + export EDITOR="nano" -# export JAVA_HOME="/usr/lib/jvm/java-21-openjdk-amd64" -export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64" -export PATH="$JAVA_HOME/bin/:$PATH" -export PATH="$PATH:/opt/nvim/bin/" -export PATH="$PATH:$HOME/.local/bin/" -export PATH="$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts/" - -if hash composer >/dev/null; then - composer_home=$(composer config -g home 2>/dev/null) - export PATH="$PATH:$composer_home/vendor/bin" -fi - -# phpbrew -# export PHPBREW_SET_PROMPT=1 -# export PHPBREW_RC_ENABLE=1 -# [ -f $HOME/.phpbrew/bashrc ] && source $HOME/.phpbrew/bashrc - -# golang -export PATH="$PATH:/usr/local/go/bin" +export NVM_DIR="$HOME/.nvm" export GOPATH="$HOME/.go" -# rust cargo -[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env" +### MacBook section +if isMac; then + # brew software + if [ -d "/opt/homebrew/bin/" ]; then + # brew itself + eval "$(/opt/homebrew/bin/brew shellenv zsh)" + addPath "/opt/homebrew/bin/" -# nvm -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion" # This loads nvm bash_completion + # nvm (not nvim!) + safeSource "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm + safeSource "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion + fi -# The next line updates PATH for Yandex Cloud CLI. -[ -f "$HOME/yandex-cloud/path.bash.inc" ] && source "$HOME/yandex-cloud/path.bash.inc" + # jbtoolbox + addPath "$HOME/Library/Application Support/JetBrains/Toolbox/scripts" -# The next line enables shell command completion for yc. -[ -f "$HOME/yandex-cloud/completion.zsh.inc" ] && source "$HOME/yandex-cloud/completion.zsh.inc" + # orbstack + safeSource "$HOME/.orbstack/shell/init.zsh" +fi +### MacBook section end -# misc -[[ -f "$HOME/.profile.local" ]] && source "$HOME/.profile.local" +### Ubuntu section +if isLinux; then + # golang + export PATH="$PATH:/usr/local/go/bin" + # export GOPATH="$HOME/.go" + + # java + # export JAVA_HOME="/usr/lib/jvm/java-21-openjdk-amd64" + export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64" + export PATH="$JAVA_HOME/bin/:$PATH" + + # nvim (not nvm!) + [ -d "/opt/nvim/bin/" ] && export PATH="$PATH:/opt/nvim/bin/" + + # rust cargo + [ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env" + + # nvm (not nvim!) + safeSource "$NVM_DIR/nvm.sh" # This loads nvm + safeSource "$NVM_DIR/bash_completion" # This loads nvm bash_completion + + if hash composer >/dev/null; then + composer_home=$(composer config -g home 2>/dev/null) + export PATH="$PATH:$composer_home/vendor/bin" + fi + + # phpbrew + # export PHPBREW_SET_PROMPT=1 + # export PHPBREW_RC_ENABLE=1 + # [ -f $HOME/.phpbrew/bashrc ] && source $HOME/.phpbrew/bashrc + + # The next line updates PATH for Yandex Cloud CLI. + [ -f "$HOME/yandex-cloud/path.bash.inc" ] && source "$HOME/yandex-cloud/path.bash.inc" + + # The next line enables shell command completion for yc. + [ -f "$HOME/yandex-cloud/completion.zsh.inc" ] && source "$HOME/yandex-cloud/completion.zsh.inc" + + # jbtoolbox + if [ -d "$HOME/.local/share/JetBrains/Toolbox/scripts/" ]; then + export PATH="$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts/" + fi +fi +### Ubuntu section end + +safeSource "$HOME/.profile.local" diff --git a/shell/.zshrc b/shell/.zshrc index d9a396c..c1d025c 100644 --- a/shell/.zshrc +++ b/shell/.zshrc @@ -6,13 +6,13 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] fi # If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH -# Path to your oh-my-zsh installation. +# Path to your Oh My Zsh installation. export ZSH="$HOME/.oh-my-zsh" # Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, +# load a random theme each time Oh My Zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes ZSH_THEME="powerlevel10k/powerlevel10k" @@ -77,13 +77,43 @@ ZSH_THEME="powerlevel10k/powerlevel10k" # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git docker docker-compose composer zsh-autosuggestions zsh-syntax-highlighting laravel) +plugins=(git docker docker-compose composer zsh-autosuggestions zsh-syntax-highlighting) source $ZSH/oh-my-zsh.sh +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='nvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh +### AAA + [[ -f ~/.bash_aliases ]] && source ~/.bash_aliases -# [[ -f ~/.bashrc.local ]] && source ~/.bashrc.local [[ -f ~/.profile ]] && source ~/.profile diff --git a/shell/README.md b/shell/README.md new file mode 100644 index 0000000..0bf2ba8 --- /dev/null +++ b/shell/README.md @@ -0,0 +1,40 @@ +## Краткое описание файлов + +- `.bashrc` — bash для интерактивного non-login: история, prompt, aliases, completion. +- `.zshrc` — zsh для интерактивного shell: плагины, тема, инициализация окружения. +- `.profile` — общие login-настройки: PATH, переменные, platform-specific config. +- `.bash_aliases` — набор пользовательских aliases для удобной навигации и команд. +- `.p10k.zsh` — конфигурация темы Powerlevel10k. + +## Иерархия загрузки + +``` +ИНТЕРАКТИВНЫЙ ШЕЛЛ +├── bash +│ ├── .bashrc +│ │ ├── .bash_aliases +│ │ └── .profile +│ └── .profile +└── zsh + ├── .zshrc + │ ├── .bash_aliases + │ ├── .profile + │ └── .p10k.zsh + └── .profile +``` + +## Загрузка по типам shell + +``` +LOGIN SHELL +├── bash: ~/.bash_profile → ~/.bash_login → ~/.profile +└── zsh: ~/.zprofile → ~/.zshrc + +INTERACTIVE NON-LOGIN +├── bash: ~/.bashrc +└── zsh: ~/.zshrc + +NON-INTERACTIVE +└── конфиги не загружаются автоматически +``` +