Setup zsh
This commit is contained in:
parent
6681ad2636
commit
25f53a9c06
7 changed files with 115 additions and 92 deletions
1
Makefile
1
Makefile
|
@ -9,6 +9,7 @@ bin:
|
|||
|
||||
bash: yaourt
|
||||
ln -sfP $(DOTFILES)/bash/.bashrc ~/.bashrc
|
||||
ln -sfP $(DOTFILES)/bash/.zshrc ~/.zshrc
|
||||
mkdir -p ~/.nvm/
|
||||
ln -sfP /usr/share/nvm/init-nvm.sh ~/.nvm/nvm.sh
|
||||
|
||||
|
|
66
bash/.bashrc
66
bash/.bashrc
|
@ -1,31 +1,47 @@
|
|||
export DOTFILES="$HOME/.dotfiles"
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
source $DOTFILES/bash/boilerplate.sh
|
||||
source $DOTFILES/bash/catfish.sh
|
||||
source $DOTFILES/bash/javascript.sh
|
||||
source $DOTFILES/bash/applications.sh
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
HISTCONTROL=ignoreboth
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
if [ -f "$(command -v lsb_release)" ]; then
|
||||
source $DOTFILES/bash/ubuntu.sh # Ubuntu only stuff
|
||||
elif [ -f "$(command -v pacman)" ]; then
|
||||
source $DOTFILES/bash/arch.sh # Arch only stuff
|
||||
# check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (debian-based only)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# Export some variables
|
||||
export ANDROID_HOME=/opt/android-sdk
|
||||
export EDITOR=/bin/nano
|
||||
# Set prompt
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
|
||||
# Extend path
|
||||
export PATH=${PATH}:${ANDROID_HOME}/tools
|
||||
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
|
||||
export PATH=${PATH}:/opt/genymobile/genymotion
|
||||
export PATH=${HOME}/.dotfiles/bin:${PATH}
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# bash aliases
|
||||
alias src="source ~/.bashrc"
|
||||
alias refresh="cd $PWD > /dev/null"
|
||||
alias c="clear"
|
||||
alias cls="clear"
|
||||
alias e="exit"
|
||||
alias please="sudo"
|
||||
alias no="yes n"
|
||||
# enable programmable completion features (you don't need to enable this, if it's already enabled in /etc/bash.bashrc and /etc/profile sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
alias src="source $HOME/.bashrc"
|
||||
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
source $DOTFILES/bash/base.sh
|
||||
|
|
21
bash/.zshrc
Normal file
21
bash/.zshrc
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Path to your oh-my-zsh installation.
|
||||
export ZSH=/usr/share/oh-my-zsh/
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# Plugins
|
||||
plugins=(git-extras catimg django npm pip pyenv python)
|
||||
|
||||
# You may need to manually set your language environment
|
||||
export LANG=en_GB.UTF-8
|
||||
|
||||
# Compilation flags
|
||||
export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
autoload -Uz colors && colors
|
||||
local ret_status="%(?:%{$fg_bold[green]%}λ :%{$fg_bold[red]%}λ )"
|
||||
export PROMPT="${ret_status} %{$fg_bold[green]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%~%{$reset_color%}$ "
|
||||
|
||||
alias src="source $HOME/.zshrc"
|
||||
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
source $DOTFILES/bash/base.sh
|
48
bash/base.sh
Normal file
48
bash/base.sh
Normal file
|
@ -0,0 +1,48 @@
|
|||
source $DOTFILES/bash/catfish.sh
|
||||
source $DOTFILES/bash/javascript.sh
|
||||
source $DOTFILES/bash/applications.sh
|
||||
|
||||
if [ -f "$(command -v lsb_release)" ]; then
|
||||
source $DOTFILES/bash/ubuntu.sh # Ubuntu only stuff
|
||||
elif [ -f "$(command -v pacman)" ]; then
|
||||
source $DOTFILES/bash/arch.sh # Arch only stuff
|
||||
fi
|
||||
|
||||
# Export some variables
|
||||
export ANDROID_HOME=/opt/android-sdk
|
||||
export EDITOR=/bin/nano
|
||||
|
||||
# Extend path
|
||||
export PATH=${PATH}:${ANDROID_HOME}/tools
|
||||
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
|
||||
export PATH=${PATH}:/opt/genymobile/genymotion
|
||||
export PATH=${HOME}/.dotfiles/bin:${PATH}
|
||||
|
||||
# bash aliases
|
||||
alias refresh="cd $PWD > /dev/null"
|
||||
alias c="clear"
|
||||
alias cls="clear"
|
||||
alias e="exit"
|
||||
alias please="sudo"
|
||||
alias no="yes n"
|
||||
|
||||
# some more ls aliases
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
|
||||
|
||||
# colored GCC warnings and errors
|
||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# colour!
|
||||
alias ls='ls --color=auto'
|
||||
alias dir='dir --color=auto'
|
||||
alias vdir='vdir --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
@ -1,66 +0,0 @@
|
|||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
HISTCONTROL=ignoreboth
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (debian-based only)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# Set prompt
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable color support
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
alias dir='dir --color=auto'
|
||||
alias vdir='vdir --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# some more ls aliases
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
|
||||
# Add an "alert" alias for long running commands
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
# enable programmable completion features (you don't need to enable this, if it's already enabled in /etc/bash.bashrc and /etc/profile sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
|
@ -66,7 +66,7 @@
|
|||
audible_bell = True
|
||||
background_darkness = 0.8
|
||||
background_image = None
|
||||
font = Monospace 11
|
||||
font = Source Code Pro 11
|
||||
foreground_color = "#bfbfbf"
|
||||
palette = "#000000:#cd0000:#00cd00:#cdcd00:#0000ee:#cd00cd:#00cdcd:#e5e5e5:#7f7f7f:#ff0000:#00ff00:#ffff00:#5c5cff:#ff00ff:#00ffff:#ffffff"
|
||||
scrollback_infinite = True
|
||||
|
|
|
@ -53,6 +53,7 @@ nodejs
|
|||
numix-themes
|
||||
nvm
|
||||
obs-studio
|
||||
oh-my-zsh-git
|
||||
postgresql
|
||||
postman-bin
|
||||
psensor
|
||||
|
@ -94,3 +95,5 @@ yaourt
|
|||
yubikey-neo-manager
|
||||
yubikey-personalization-gui
|
||||
zeal
|
||||
zsh
|
||||
zsh-doc
|
||||
|
|
Loading…
Reference in a new issue