From 9e6448c6ae3e718f849ae59eec5048e3f347868f Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Wed, 4 Sep 2019 16:19:59 -0400 Subject: [PATCH] Dotfiles install and backup script --- .dotfiles/.zshrc | 21 +++++++++++++++++++++ scripts/dotfiles.sh | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .dotfiles/.zshrc create mode 100644 scripts/dotfiles.sh diff --git a/.dotfiles/.zshrc b/.dotfiles/.zshrc new file mode 100644 index 0000000..239d85e --- /dev/null +++ b/.dotfiles/.zshrc @@ -0,0 +1,21 @@ +HISTFILE=~/.zsh_history +HISTSIZE=99999999 +SAVEHIST=99999999 +setopt appendhistory autocd extendedglob nomatch notify +unsetopt beep +bindkey -e +zstyle :compinstall filename '~/.zshrc' + +autoload -Uz compinit +compinit + +# Text Editor +alias emacs='emacs -nw' +alias e='emacs -nw' +alias i='sudo dnf install' +alias d='sudo dnf' +alias c='git commit -m ' +alias g='git' +alias gp='git pull' + +export TERM=linux diff --git a/scripts/dotfiles.sh b/scripts/dotfiles.sh new file mode 100644 index 0000000..033e3bc --- /dev/null +++ b/scripts/dotfiles.sh @@ -0,0 +1,16 @@ +#! /bin/bash + +# source backup sudo +files=(~/.zshrc ~/.config/.dotfiles/.zshrc 'n') + +for (( i=0; i<${#files[@]} ; i+=3 )) ; do + if [[ $* == *-b* ]]; then + cp ${files[i]} ${files[i+1]} + else + if [[ ${files[i+2]} == *'y'* ]]; then + sudo cp ${files[i+1]} ${files[i]} + else + cp ${files[i+1]} ${files[i]} + fi + fi +done