From 89b5b6cd324c5a25ca7f75d04a24a5ece8362f79 Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Mon, 23 Sep 2019 10:40:12 -0400 Subject: [PATCH] Cleaned some cruft out from zshrc --- zsh/zshrc | 87 +++++++------------------------------------------------ 1 file changed, 10 insertions(+), 77 deletions(-) diff --git a/zsh/zshrc b/zsh/zshrc index 37ba57e..a2f5a5f 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -25,7 +25,6 @@ zle -N down-line-or-beginning-search [[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search - autoload -Uz compinit promptinit promptinit compinit @@ -33,9 +32,7 @@ compinit export COMPLETION_WAITING_DOTS="true" export VISUAL='nvim' export EDITOR='nvim' -export ANDROID_HOME=$HOME/Android/sdk -export PATH=$HOME/bin:$PATH:$ANDROID_HOME/platform-tools - +export PATH=$HOME/bin:$PATH # antigen source $HOME/.antigen/antigen.zsh @@ -47,81 +44,17 @@ antigen bundle vi-mode antigen bundle zsh-users/zsh-syntax-highlighting antigen bundle zsh-users/zsh-completions antigen bundle ress997/zsh-completions-anyenv -if [[ ! ($(uname) -eq "Darwin") ]]; then - antigen bundle matthieusb/zsh-sdkman -fi +antigen bundle matthieusb/zsh-sdkman if [[ -e ~/.cargo/bin/starship ]]; then eval "$(~/.cargo/bin/starship init zsh)" else antigen theme denysdovhan/spaceship-prompt fi -# antigen theme romkatv/powerlevel10k powerlevel10k antigen apply - -# custom functions for powerlevel9k -POWERLEVEL9K_ELIXIR_ICON=$'💧' -POWERLEVEL9K_PYTHON_ICON=$'\U1F40D' - -prompt_custom_virtualenv() { - local virtualenv_path="$VIRTUAL_ENV" - if [[ -n "$virtualenv_path" && "$VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then - local python_version="$(python --version | cut -d ' ' -f 2)" - echo -n "$POWERLEVEL9K_PYTHON_ICON $(python --version) in $(basename $(dirname $virtualenv_path))" - fi -} -POWERLEVEL9K_CUSTOM_VIRTUALENV="prompt_custom_virtualenv" - - -prompt_asdf_elixir() { - if [ $commands[asdf] ]; then - ELIXIR_ICON=$'💧' - local asdf_global_conf="$HOME/.tool-versions" - local version_regex="s/^\([.0-9]*\).*/\1/p" - local config_regex="s/.*(set by \(.*\))/\1/p" - - local elixir_current="$(asdf current elixir)" - local elixir_current_version="$(echo $elixir_current | sed -n $version_regex)" - local elixir_current_conf="$(echo $elixir_current | sed -n $config_regex)" - - local erlang_current="$(asdf current erlang)" - local erlang_current_version="$(echo $erlang_current | sed -n $version_regex)" - local erlang_current_conf="$(echo $erlang_current | sed -n $config_regex)" - if [[ "${asdf_global_conf}" != "${elixir_current_conf}" || "${asdf_global_conf}" != "${erlang_current_conf}" ]]; then - echo -n "💧 $elixir_current_version (on Erlang $erlang_current_version)" - fi -fi -} -POWERLEVEL9K_CUSTOM_ASDF_ELIXIR="prompt_asdf_elixir" - -export POWERLEVEL9K_IGNORE_TERM_COLORS=true -export POWERLEVEL9K_PROMPT_ON_NEWLINE=true -export POWERLEVEL9K_PROMPT_ADD_NEWLINE=true -export POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="" -export POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="$fg[yellow]>$fg[magenta]>$fg[blue]> " -export POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir dir_writable vcs custom_asdf_elixir) -export POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_virtualenv command_execution_time) -export VIRTUAL_ENV_DISABLE_PROMPT=1 - - - -alias 'onedrive-journal'="journalctl --user-unit onedrive -f" alias exa="exa -l --git" -alias 'gld'='git log --graph --decorate' - -# pip 10.0.1 zsh completion start -function _pip_completion { - local words cword - read -Ac words - read -cn cword - reply=( $( COMP_WORDS="$words[*]" \ - COMP_CWORD=$(( cword-1 )) \ - PIP_AUTO_COMPLETE=1 $words[1] ) ) -} -compctl -K _pip_completion pip -# pip zsh completion end # export TERM="tmux-256color" export SHELL="/bin/zsh" @@ -147,13 +80,6 @@ function _send_to_pane { } compctl -K _send_to_pane send-to-pane -if [[ -a $HOME/.zshsrc ]]; then - source $HOME/.zshsrc -else - printf "No zshsrc\nOne has been created" - touch $HOME/.zshsrc -fi - function fzf_hist() { local sed_cmd if [[ $(uname -s) == "Darwin" ]]; then @@ -168,7 +94,14 @@ bindkey -s "\C-r" "\eifzf_hist\n" export PATH="$PATH:$HOME/.anyenv/bin" eval "$(anyenv init -)" export PATH="$(yarn global bin):$PATH" -# + #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! export SDKMAN_DIR="$HOME/.sdkman" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" + +if [[ -a $HOME/.zshsrc ]]; then + source $HOME/.zshsrc +else + printf "No zshsrc\nOne has been created\n" + touch $HOME/.zshsrc +fi