2020-05-16 20:23:07 +00:00
|
|
|
#
|
|
|
|
# ~/.bashrc
|
|
|
|
#
|
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
#if not running interactively, don't do anything
|
2020-05-16 20:23:07 +00:00
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
set -o vi
|
|
|
|
PS1='\[\e[31m\]\W\[\e[m\] \[\e[32m\]>\[\e[m\] '
|
|
|
|
#export vblank_mode=0
|
2020-05-16 20:23:07 +00:00
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
# I don't know what these do for now, might or might not break something if disabled
|
|
|
|
#unset use_color safe_term match_lhs sh
|
|
|
|
#use_color=true
|
|
|
|
#xhost +local:root > /dev/null 2>&1
|
|
|
|
#complete -cf sudo
|
2020-05-16 20:23:07 +00:00
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
alias cp='cp -i' # confirm before overwriting something
|
|
|
|
alias df='df -h' # human-readable sizes
|
|
|
|
alias du='du -h'
|
|
|
|
alias free='free -h'
|
2020-05-16 20:23:07 +00:00
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
alias ls='ls --color=auto'
|
|
|
|
alias grep='grep --colour=auto'
|
|
|
|
alias egrep='egrep --colour=auto'
|
|
|
|
alias fgrep='fgrep --colour=auto'
|
2020-05-16 20:23:07 +00:00
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
# [[ Not sure about these, guess I'll just keep them...
|
2020-05-16 20:23:07 +00:00
|
|
|
|
|
|
|
# Bash won't get SIGWINCH if another process is in the foreground.
|
|
|
|
# Enable checkwinsize so that bash will check the terminal size when
|
|
|
|
# it regains control. #65623
|
|
|
|
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
|
|
|
|
shopt -s checkwinsize
|
|
|
|
shopt -s expand_aliases
|
|
|
|
|
|
|
|
# Enable history appending instead of overwriting. #139609
|
|
|
|
shopt -s histappend
|
2021-02-06 10:45:04 +00:00
|
|
|
# ]]
|
2020-05-16 20:23:07 +00:00
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
# # ext - archive extractor
|
|
|
|
# # usage: ext <file>
|
|
|
|
ext ()
|
2020-05-16 20:23:07 +00:00
|
|
|
{
|
|
|
|
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 ;;
|
2021-02-06 10:45:04 +00:00
|
|
|
*) echo "'$1' cannot be extracted via ext()" ;;
|
2020-05-16 20:23:07 +00:00
|
|
|
esac
|
|
|
|
else
|
|
|
|
echo "'$1' is not a valid file"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# User added aliases
|
2020-08-22 16:04:56 +00:00
|
|
|
alias vim='nvim'
|
2020-05-16 20:23:07 +00:00
|
|
|
|
2021-02-06 10:45:04 +00:00
|
|
|
#rclone syncs
|
2020-05-16 20:23:07 +00:00
|
|
|
alias rclone-up-projecte_drawings="rclone sync ~/Documents/Projecte\ drawings/ 'Main gDrive':/'Projecte drawings' -P"
|
|
|
|
alias rclone-up-music="rclone sync /run/media/vibikim/WAD/Music/ gdrive_music:/Music -P"
|
|
|
|
|
|
|
|
alias rclone-down-projecte_drawings="rclone sync 'Main gDrive':/'Projecte drawings' ~/Documents/Projecte\ drawings/ -P"
|
|
|
|
alias rclone-down-music="rclone sync gdrive_music:/Music /run/media/vibikim/WAD/Music/ -P"
|