diff --git a/.zsh/aliases.zsh b/.zsh/aliases.zsh new file mode 100644 index 0000000..c642320 --- /dev/null +++ b/.zsh/aliases.zsh @@ -0,0 +1,3 @@ +alias wget='wget -c' +alias zshrc='source ~/.zshrc' +alias dps='docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.Status}}"' diff --git a/.zsh/cdtemp.zsh b/.zsh/cdtemp.zsh new file mode 100644 index 0000000..6037070 --- /dev/null +++ b/.zsh/cdtemp.zsh @@ -0,0 +1 @@ +cdtemp () { cd $(mktemp -d) } diff --git a/.zsh/powerlevel_settings.sh b/.zsh/powerlevel_settings.sh new file mode 100644 index 0000000..08d47e2 --- /dev/null +++ b/.zsh/powerlevel_settings.sh @@ -0,0 +1,9 @@ +# POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs) +if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator context dir vcs) +else + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator dir vcs) +fi +# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time) +POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs disk_usage) +POWERLEVEL9K_MODE='nerdfont-complete' diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..284294f --- /dev/null +++ b/.zshrc @@ -0,0 +1,28 @@ +export TERM="xterm-256color" +export OTHER=$HOME/.zsh +export ZSH=$HOME/.oh-my-zsh +export ZSH_THEME="powerlevel9k/powerlevel9k" +source $OTHER/powerlevel_settings.sh +source $ZSH/oh-my-zsh.sh + +COMPLETION_WAITING_DOTS="true" + +plugins=(git docker) + +export EDITOR=nano +export JAVA_HOME= + +for f in $OTHER/*; do + if [ -f $f ]; then + source $f + fi +done + +if [ -d "$HOME/.zsh-custom" ]; then + for f in $HOME/.zsh-custom/*; do + if [ -f $f ]; then + source $f + fi + done +fi + autoload -Uz compinit && compinit -i diff --git a/README.md b/README.md index ba9569e..73b02d0 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,5 @@ ### The inspiration taken from [ptrcnull](https://github.com/ptrcnull/)[/dotfiles](https://github.com/ptrcnull/dotfiles) ------ -### More practical version of [linuxscripts](https://github.com/mlunax/linuxscript) +### More practical version of [linuxscripts](https://github.com/mlunax/linuxscripts) ------ diff --git a/install.zsh b/install.zsh new file mode 100644 index 0000000..c0c9bbc --- /dev/null +++ b/install.zsh @@ -0,0 +1,14 @@ +#!/usr/bin/env zsh +# env, because some OSes keep zsh in /bin (I'm looking at you, Alpine) +cp .zshrc $HOME +if [ ! -d "${HOME}/.oh-my-zsh" ]; then + sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +fi +if [ ! -d "${HOME}/.oh-my-zsh/custom/themes/powerlevel9k" ]; then + git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k +fi +if [ -d "${HOME}/.zsh" ]; then + rm -r $HOME/.zsh +fi +cp -r .zsh $HOME +source $HOME/.zshrc