2022-04-22 14:53:45 +02:00
|
|
|
# If you come from bash you might have to change your $PATH.
|
|
|
|
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
|
|
|
|
|
|
|
# Path to your oh-my-zsh installation.
|
|
|
|
export ZSH="$HOME/.oh-my-zsh"
|
|
|
|
|
|
|
|
# Set name of the theme to load --- if set to "random", it will
|
|
|
|
# load a random theme each time oh-my-zsh is loaded, in which case,
|
|
|
|
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
|
|
|
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
|
|
|
|
ZSH_THEME="mrfortem"
|
|
|
|
|
2022-04-27 11:40:17 +02:00
|
|
|
# Case-sensitive completion.
|
2022-06-02 12:18:15 +02:00
|
|
|
CASE_SENSITIVE="false"
|
2022-04-22 14:53:45 +02:00
|
|
|
|
|
|
|
# Uncomment the following line to use hyphen-insensitive completion.
|
|
|
|
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
2022-06-02 12:18:15 +02:00
|
|
|
HYPHEN_INSENSITIVE="true"
|
2022-04-22 14:53:45 +02:00
|
|
|
|
2022-04-27 11:40:17 +02:00
|
|
|
# Auto-update behavior
|
|
|
|
zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
2022-04-22 14:53:45 +02:00
|
|
|
|
|
|
|
# Uncomment the following line to change how often to auto-update (in days).
|
|
|
|
# zstyle ':omz:update' frequency 13
|
|
|
|
|
|
|
|
# Uncomment the following line if pasting URLs and other text is messed up.
|
|
|
|
# DISABLE_MAGIC_FUNCTIONS="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to enable command auto-correction.
|
|
|
|
# ENABLE_CORRECTION="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to display red dots whilst waiting for completion.
|
|
|
|
# You can also set it to another string to have that shown instead of the default red dots.
|
|
|
|
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
|
|
|
|
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
|
|
|
|
# COMPLETION_WAITING_DOTS="true"
|
|
|
|
|
|
|
|
# Uncomment the following line if you want to disable marking untracked files
|
|
|
|
# under VCS as dirty. This makes repository status check for large repositories
|
|
|
|
# much, much faster.
|
|
|
|
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
|
|
|
|
2022-04-27 11:40:17 +02:00
|
|
|
# History timestamp format
|
2022-06-02 12:18:15 +02:00
|
|
|
HIST_STAMPS="dd/mm/yyyy"
|
2022-04-22 14:53:45 +02:00
|
|
|
|
|
|
|
# Would you like to use another custom folder than $ZSH/custom?
|
|
|
|
# ZSH_CUSTOM=/path/to/new-custom-folder
|
|
|
|
|
|
|
|
# Which plugins would you like to load?
|
|
|
|
# Standard plugins can be found in $ZSH/plugins/
|
|
|
|
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
|
|
|
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
|
|
|
# Add wisely, as too many plugins slow down shell startup.
|
|
|
|
plugins=(git dirhistory screen)
|
|
|
|
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
|
|
|
|
# User configuration
|
|
|
|
|
|
|
|
# export MANPATH="/usr/local/man:$MANPATH"
|
|
|
|
|
|
|
|
# You may need to manually set your language environment
|
|
|
|
# export LANG=en_US.UTF-8
|
|
|
|
|
|
|
|
# Preferred editor for local and remote sessions
|
|
|
|
# if [[ -n $SSH_CONNECTION ]]; then
|
|
|
|
# export EDITOR='vim'
|
|
|
|
# else
|
|
|
|
# export EDITOR='mvim'
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# Compilation flags
|
|
|
|
# export ARCHFLAGS="-arch x86_64"
|
|
|
|
|
2022-06-02 12:18:15 +02:00
|
|
|
use_color=true
|
|
|
|
if ${use_color} ; then
|
|
|
|
alias ls='ls --color=auto'
|
|
|
|
alias grep='grep --colour=auto'
|
|
|
|
alias egrep='egrep --colour=auto'
|
|
|
|
alias fgrep='fgrep --colour=auto'
|
|
|
|
fi
|
|
|
|
|
2022-04-22 14:53:45 +02:00
|
|
|
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
|
|
|
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
|
|
|
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
|
|
|
# For a full list of active aliases, run `alias`.
|
|
|
|
#
|
|
|
|
# Example aliases
|
|
|
|
alias cp="cp -i" # confirm before overwriting something
|
|
|
|
alias df='df -h' # human-readable sizes
|
|
|
|
alias free='free -m' # show sizes in MB
|
|
|
|
alias np='nano -w PKGBUILD'
|
|
|
|
alias more=less
|
2022-06-02 12:18:15 +02:00
|
|
|
alias hgrep='history | grep'
|
2022-04-22 14:53:45 +02:00
|
|
|
alias psql='psql -U postgres'
|
|
|
|
alias rmou='rclone mount OneDriveUGent: ~/Documents/OneDriveUGent/'
|
|
|
|
alias rmop='rclone mount OneDrivePersonal: ~/Documents/OneDrivePersonal'
|
|
|
|
alias helios='ssh tdpeuter@helios.ugent.be'
|
|
|
|
alias resblue='systemctl restart bluetooth'
|
2022-05-31 13:54:50 +02:00
|
|
|
alias Personal='cd ~/Documents/synchronisatie/Personal/_PERSOONLIJK/'
|
|
|
|
alias UGent='cd ~/Documents/synchronisatie/UGent/Informatica\ J1\ 2021-2022/'
|
2022-06-13 11:34:58 +02:00
|
|
|
alias vol='~/.scripts/vol.sh'
|
2022-06-02 12:18:15 +02:00
|
|
|
|
2022-06-13 11:34:58 +02:00
|
|
|
sshgit () {
|
|
|
|
|
|
|
|
# Check arguments
|
|
|
|
if [[ $# -lt 2 ]] ; then
|
|
|
|
echo "Requires at least two arguments"
|
|
|
|
exit 1
|
2022-06-05 17:27:54 +02:00
|
|
|
fi
|
|
|
|
|
2022-06-13 11:34:58 +02:00
|
|
|
ssh_key="$1"
|
|
|
|
shift
|
|
|
|
GIT_SSH_COMMAND="ssh -i ${ssh_key}" git $@
|
|
|
|
|
2022-06-05 17:27:54 +02:00
|
|
|
}
|
|
|
|
|
2022-06-02 12:18:15 +02:00
|
|
|
cpdir () {
|
|
|
|
|
|
|
|
# Check arguments
|
|
|
|
if [[ $# == 2 ]] ; then
|
|
|
|
from=$(dirname $1)
|
|
|
|
fromfile=$(basename $1)
|
|
|
|
to=$(dirname $2)
|
|
|
|
tofile=$(basename $2)
|
|
|
|
else
|
|
|
|
echo "cpdir: Not enough arguments"
|
|
|
|
echo "cpdir: Syntaxis: cpdir <source> <destination>"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check file
|
|
|
|
if [[ ! -f $1 ]] ; then
|
|
|
|
echo "cpdir: Source does not exist: $1"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Move ${fromfile} from ${from} to ${to} as ${tofile}?"
|
|
|
|
echo -n "y/n > "
|
|
|
|
read answer
|
|
|
|
|
|
|
|
if [[ ${answer} == "y" ]] ; then
|
|
|
|
mkdir -pv $to
|
|
|
|
cp $1 $2
|
|
|
|
echo "Done"
|
|
|
|
elif [[ ${answer} == "n" ]] ; then
|
|
|
|
echo "Not copying..."
|
|
|
|
else
|
|
|
|
echo "Invalid option"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# ex - arrchive extractor
|
|
|
|
# usage: ex <file>
|
|
|
|
ex () {
|
|
|
|
if [ -f $1 ] ; then
|
|
|
|
case $1 in
|
|
|
|
*.tar.bz2) tar xjf $1 ;;
|
|
|
|
*.tar.gz) tar xzf $1 ;;
|
|
|
|
*.bz2) bunzip2 $1 ;;
|
|
|
|
*.rar) unrar x $1 ;;
|
|
|
|
*.gz) gunzip $1 ;;
|
|
|
|
*.tar) tar xf $1 ;;
|
|
|
|
*.tbz2) tar xjf $1 ;;
|
|
|
|
*.tgz) tar xzf $1 ;;
|
|
|
|
*.zip) unzip $1 ;;
|
|
|
|
*.Z) uncompress $1 ;;
|
|
|
|
*.7z) 7z x $1 ;;
|
|
|
|
*)
|
|
|
|
echo "'$1' cannot be extracted via ex()"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
echo "'$1' is not a valid file"
|
|
|
|
fi
|
|
|
|
}
|