diff --git a/.zshrc b/.zshrc index 08e6f0b..4ee5001 100644 --- a/.zshrc +++ b/.zshrc @@ -1,3 +1,10 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + # Lines configured by zsh-newuser-install HISTFILE=~/.histfile HISTSIZE=1000 @@ -11,9 +18,6 @@ autoload -Uz compinit compinit # End of lines added by compinstall -eval "$(oh-my-posh init zsh)" - - # personal aliases alias ls='ls --color=auto' alias la='ls -a' @@ -23,6 +27,30 @@ alias mv='mv -v' alias rm='rm -v' alias ..='cd ..' -#Java home +# Java home export JAVA_HOME=/usr/lib/jvm/default +# Plugin idea copy from https://github.com/KulkarniKaustubh/dotfiles/blob/main/zsh/.plugins.zsh +# check if ~/.zsh exists +if [ ! -d "$HOME/.zsh" ]; then + echo "Creating a .zsh folder in $HOME" + echo "This can be copied elsewhere and then linked, preferrably using GNU stow" + mkdir $HOME/.zsh +fi + +# check if p10k exists +if [ ! -d "$HOME/.zsh/powerlevel10k" ]; then + echo "Installing powerelevel10k theme." + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $HOME/.zsh/powerlevel10k +fi +source $HOME/.zsh/powerlevel10k/powerlevel10k.zsh-theme + +# check if zsh autosuggest exists +if [ ! -d "$HOME/.zsh/zsh-autosuggestions" ]; then + echo "Installing zsh autosuggestions." + git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.zsh/zsh-autosuggestions +fi +source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh