diff --git a/Makefile b/Makefile index bbfc3dd..b0b2536 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,21 @@ macos: link link_mac mac_setup bash_git_prompt brew cask tmux vim link: -rm ~/.aliases - -rm ~/.bashrc -rm ~/.bash_profile + -rm ~/.bashrc -rm ~/.git-completion.bash -rm ~/.gitconfig -rm ~/.tmux.conf + -rm ~/.zsh/.zprompt + -rm ~/.zsh/.zshrc + mkdir -p ~/.zshs + ln -s ~/Git/dotfiles/git/.git-completion.bash ~ + ln -s ~/Git/dotfiles/git/.gitconfig ~ ln -s ~/Git/dotfiles/shell/.aliases ~ ln -s ~/Git/dotfiles/shell/.bashrc ~ ln -s ~/Git/dotfiles/shell/.bash_profile ~ - ln -s ~/Git/dotfiles/git/.git-completion.bash ~ - ln -s ~/Git/dotfiles/git/.gitconfig ~ + ln -s ~/Git/dotfiles/shell/.zprompt ~/.zsh/ + ln -s ~/Git/dotfiles/shell/.zshrc ~/.zsh/ ln -s ~/Git/dotfiles/tmux/.tmux.conf ~ link_mac: diff --git a/shell/.zprompt b/shell/.zprompt new file mode 100644 index 0000000..a6a1035 --- /dev/null +++ b/shell/.zprompt @@ -0,0 +1,20 @@ +source $HOME/Git/zsh-git-prompt/zshrc.sh + +setopt PROMPT_SUBST + +HOSTN="$(hostname | tr '[:upper:]' '[:lower:]')" + +PROMPT='%B%U%F{cyan}% %m%u%F{green} %~$(git_super_status)%f %b ' +RPROMPT='%*' + +ZSH_THEME_GIT_PROMPT_PREFIX=" $fg_bold[cyan]% (" +ZSH_THEME_GIT_PROMPT_SUFFIX="$fg_bold[cyan]% )" +ZSH_THEME_GIT_PROMPT_SEPARATOR="$fg_bold[cyan]% |" +ZSH_THEME_GIT_PROMPT_BRANCH="" +ZSH_THEME_GIT_PROMPT_STAGED="%F{green}% %{●%G%}" +ZSH_THEME_GIT_PROMPT_CONFLICTS="%B%F{red}% %{✖%G%}" +ZSH_THEME_GIT_PROMPT_CHANGED="%B%F{red}% %{✚%G%}" +ZSH_THEME_GIT_PROMPT_BEHIND="%F{magenta}% %{↓%G%}" +ZSH_THEME_GIT_PROMPT_AHEAD="%B%F{yellow}% %{↑%G%}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%B%F{42}% %{…%G%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%F{cyan}% %{✔%G%}" diff --git a/shell/.zshrc b/shell/.zshrc new file mode 100644 index 0000000..59a663b --- /dev/null +++ b/shell/.zshrc @@ -0,0 +1,51 @@ +ZDOTDIR=$HOME/.zsh + +source $ZDOTDIR/.zprompt + + +setopt AUTO_CD +setopt NO_CASE_GLOB +setopt GLOB_COMPLETE + +setopt CORRECT +setopt CORRECT_ALL + +autoload -Uz compinit && compinit + + +# -------- +# History +# -------- + +HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history +SAVEHIST=50000 +HISTSIZE=10000 + +setopt EXTENDED_HISTORY +# share history across multiple zsh sessions +setopt SHARE_HISTORY +# append to history +setopt APPEND_HISTORY +# adds commands as they are typed, not at shell exit +setopt INC_APPEND_HISTORY +# do not store duplications +setopt HIST_IGNORE_DUPS +# removes blank lines from history +setopt HIST_REDUCE_BLANKS +# show !! before executing +setopt HIST_VERIFY + +# -------- +# Source & include +# -------- + +# Include functions +fpath+=$HOME/Git/dotfiles/functions +autoload extract + +# load bashcompinit for some old bash completions +autoload bashcompinit && bashcompinit + +source $ZDOTDIR/.zshrc.local +source $HOME/.aliases +source $HOME/.aliases.local