trimmed some stuff and reorganized the dotfiles
This commit is contained in:
parent
3f5e822fb3
commit
5024639019
28 changed files with 375 additions and 174 deletions
33
config/zsh/zshrc
Normal file
33
config/zsh/zshrc
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Exports
|
||||
export DOTFILES="${HOME}/dotfiles"
|
||||
export DOTFILES_CONFIG="${DOTFILES}/config"
|
||||
export LIB="${DOTFILES}/lib"
|
||||
export ZSH="${LIB}/ohmyzsh"
|
||||
export PATH="${HOME}/dotfiles/bin:/opt/android-sdk/build-tools/26.0.0/:${PATH}"
|
||||
export EDITOR='nano'
|
||||
export TERM=linux
|
||||
fpath=(${LIB}/completions/src $fpath)
|
||||
|
||||
# Settings
|
||||
ZSH_THEME="mortalscumbag"
|
||||
DISABLE_AUTO_UPDATE="true"
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
|
||||
|
||||
# Plugins
|
||||
plugins=(git vagrant docker systemd tmux command-not-found extract)
|
||||
case $(uname -n) in
|
||||
"megumi") plugins+=(archlinux) ;;
|
||||
"sayaka") plugins+=(archlinux) ;;
|
||||
"git") plugins+=(debian) ;;
|
||||
esac
|
||||
|
||||
# Fix MobaXterm Home/End key with ZSH
|
||||
bindkey '^[[H' beginning-of-line
|
||||
bindkey '^[[F' end-of-line
|
||||
|
||||
# Source the needed parts
|
||||
source ${ZSH}/oh-my-zsh.sh # Oh My ZSH
|
||||
source ${LIB}/highlighting/zsh-syntax-highlighting.zsh # Syntax Highlighting
|
||||
for file in ${DOTFILES_CONFIG}/zsh/zshrc.d/*.zsh; do source $file; done # Other Files
|
||||
source ${HOME}/.fzf.zsh # FZF
|
||||
eval `dircolors ${DOTFILES_CONFIG}/dir/dircolors` # Dircolors
|
19
config/zsh/zshrc.d/aliases.zsh
Normal file
19
config/zsh/zshrc.d/aliases.zsh
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Interactive
|
||||
alias rm='rm -i'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
|
||||
# Listing
|
||||
alias l='ls -lh' #size,show type,human readable
|
||||
alias la='ls -lAh' #long list,show almost all,show type,human readable
|
||||
alias lr='ls -tRh' #sorted by date,recursive,show type,human readable
|
||||
alias lt='ls -lth' #long list,sorted by date,show type,human readable
|
||||
|
||||
# The Fuck
|
||||
TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
|
||||
|
||||
# PClear
|
||||
clearall () { clear; printf '\033[3J' }
|
||||
|
||||
# Make Dir and enter it
|
||||
mkcd() { mkdir $1 &>/dev/null; [ -e $1 ] && cd $1 }
|
54
config/zsh/zshrc.d/transfer.zsh
Normal file
54
config/zsh/zshrc.d/transfer.zsh
Normal file
|
@ -0,0 +1,54 @@
|
|||
#
|
||||
# Defines transfer alias and provides easy command line file and folder sharing.
|
||||
#
|
||||
# Authors:
|
||||
# Remco Verhoef <remco@dutchcoders.io>
|
||||
#
|
||||
|
||||
transfer() {
|
||||
# check arguments
|
||||
if [ $# -eq 0 ];
|
||||
then
|
||||
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# get temporarily filename, output is written to this file show progress can be showed
|
||||
tmpfile=$( mktemp -t transferXXX )
|
||||
|
||||
# upload stdin or file
|
||||
file=$1
|
||||
|
||||
if tty -s;
|
||||
then
|
||||
basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
|
||||
|
||||
if [ ! -e $file ];
|
||||
then
|
||||
echo "File $file doesn't exists."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -d $file ];
|
||||
then
|
||||
# zip directory and transfer
|
||||
zipfile=$( mktemp -t transferXXX.zip )
|
||||
cd $(dirname $file) && zip -r -q - $(basename $file) >> $zipfile
|
||||
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
|
||||
rm -f $zipfile
|
||||
else
|
||||
# transfer file
|
||||
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
|
||||
fi
|
||||
else
|
||||
# transfer pipe
|
||||
curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
|
||||
fi
|
||||
|
||||
# cat output link
|
||||
cat $tmpfile
|
||||
|
||||
# cleanup
|
||||
rm -f $tmpfile
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue