.dotfiles/shell/zshrc

76 lines
1.4 KiB
Bash
Raw Normal View History

2018-08-18 13:15:18 +02:00
# Path to your oh-my-zsh installation.
2018-11-25 11:32:52 +01:00
export ZSH="$HOME/.oh-my-zsh"
2018-08-18 13:15:18 +02:00
# plugins
if [ -f ~/.dotfiles/shell/plugins ]
then
source ~/.dotfiles/shell/plugins
else
plugins=(
git
pip
screen
2020-11-05 05:02:25 +01:00
artisan
dirhistory
per-directory-history
z
)
fi
2018-08-18 13:15:18 +02:00
source $ZSH/oh-my-zsh.sh
2020-12-19 19:42:26 +01:00
2018-08-18 13:15:18 +02:00
# User configuration
# Helper Functions
# Returns whether the given command is executable or aliased.
_has() {
return $( whence $1 >/dev/null )
}
2018-08-18 13:15:18 +02:00
2018-12-07 12:15:50 +01:00
# Set vim as default editor
export EDITOR='vim'
# aliases
2018-08-18 13:15:18 +02:00
alias ll='ls -l'
alias la='ls -la'
2019-01-19 16:34:16 +01:00
alias :q='exit'
alias fresh="source ~/.zshrc"
2020-12-19 19:42:26 +01:00
# ZSH Theme
ZSH_THEME=""
PROMPT_COLOR="cyan"
# localcommands
if [ -f ~/.dotfiles/shell/localcommands ]
2018-08-18 13:15:18 +02:00
then
source ~/.dotfiles/shell/localcommands
2018-08-18 13:15:18 +02:00
fi
2020-12-19 19:42:26 +01:00
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[${PROMPT_COLOR}]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
2018-12-07 12:32:38 +01:00
# Tmuxinator autocomplete
if [ -f ~/.bin/tmuxinator.zsh ]; then
source ~/.bin/tmuxinator.zsh
fi
# fzf + ag configuration
if _has fzf && _has ag; then
export FZF_CTRL_T_COMMAND='ag --hidden --nocolor --ignore .git -g ""'
2018-12-07 12:32:38 +01:00
fi
2019-01-19 15:02:34 +01:00
export FZF_ALT_C_COMMAND='find . -type d'
2019-01-19 16:34:16 +01:00
2019-12-11 23:23:02 +01:00
if _has ruby;
then
export PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin"
fi