X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/ec48932ff896ba580d9d9039d990a7cbd05eb549..f3e9f5c17a6ba27ae5715a566b1454031f5a10da:/zsh/modules/prompt.zsh?ds=sidebyside diff --git a/zsh/modules/prompt.zsh b/zsh/modules/prompt.zsh index b21a41f..615ca95 100644 --- a/zsh/modules/prompt.zsh +++ b/zsh/modules/prompt.zsh @@ -4,49 +4,6 @@ if [[ "$TERM" == (dumb|linux|*bsd*) ]] || (( $#prompt_argv < 1 )); then prompt 'off' fi -# -# Precmd -# - -function prompt_precmd { - git-info -} - -# -# Functions -# - -function virtualenv_info { - if [[ -z "$VIRTUAL_ENV" ]]; then - venv="default" - else - venv="${VIRTUAL_ENV##*/}" - fi - echo "🐍 ${venv}" -} - -function rvm_info { - if [[ -z "$RUBY_VERSION" ]]; then - rvminfo="default" - else - rvminfo=`rvm-prompt` - fi - echo "💎 ${rvminfo}" -} - -function nvm_info { - if [[ -z "$NVM_BIN" ]]; then - nvminfo="default" - else - nvminfo=`nvm current` - fi - echo "💛 ${nvminfo}" -} - -function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || hostname -s -} - # # ZLE widgets # @@ -56,13 +13,9 @@ function zle-line-init zle-keymap-select { # Couldn't figure out how to get tmux and iTerm to agree on how to render # these characters... so there you go. - local normal_symbol="🅽" - local insert_symbol="🅸" - local error_symbol="🆇" - - [ ! -z "$TMUX" ] && normal_symbol="%{$normal_symbol%2G%}" - [ ! -z "$TMUX" ] && insert_symbol="%{$insert_symbol%2G%}" - [ ! -z "$TMUX" ] && error_symbol="%{$error_symbol%2G%}" + local normal_symbol="N" + local insert_symbol="I" + local error_symbol="X" # Show vi status / return status on the right side @@ -91,24 +44,11 @@ function prompt_setup { # Load required functions. autoload -Uz add-zsh-hook - # Add hook for calling git-info before each command. - add-zsh-hook precmd prompt_precmd - - # Set git-info parameters. - zstyle ':git:info' verbose 'no' - zstyle ':git:info:branch' format '@%F{cyan}%b%f' - zstyle ':git:info:clean' format '' - zstyle ':git:info:added' format '%{%F{green}%}!' - zstyle ':git:info:modified' format '%{%F{green}%}?' - zstyle ':git:info:untracked' format '%{%F{magenta}%}?' - zstyle ':git:info:keys' format \ - 'prompt' '%b%a%m%u' - # Define prompts. PROMPT=' -%{%F{black}%}$(nvm_info) $(rvm_info) $(virtualenv_info) -%{%F{magenta}%}%n%{%f%}@%{%F{yellow}%}$(box_name)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}${git_info[prompt]} %{%f%} -%(?,,%{${%B%F{white}%}[%?]%{%f%b%} )$ ' +%{%F{black}%}$(env_info) $(node_info) $(rust_info) $(python_info) +%{%F{magenta}%}%n%{%f%}@%{%F{yellow}%}$(hostname -s)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}$(git_info)%{%f%} +%(?,,%{${%B%F{white}%}[%?]%{%f%b%} )%% ' } prompt_setup "$@"