diff --git a/base/.config/bash/bashrc.d/aliases.sh b/base/.config/bash/bashrc.d/aliases.sh index b00ad8b..69f206b 100644 --- a/base/.config/bash/bashrc.d/aliases.sh +++ b/base/.config/bash/bashrc.d/aliases.sh @@ -16,7 +16,6 @@ alias wget-opendir='wget --recursive --level 0 --continue --no-clobber \ --reject=html,htm,index' alias numfiles='find . -maxdepth 1 -type f | wc -l' -alias slugify="sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z" alias take='sudo chown $(whoami):$(whoami) ' if [[ $(uname) == Linux ]]; then diff --git a/base/.config/profile/profile.d/base.sh b/base/.config/profile/profile.d/base.sh index 5ed57a8..d2229ad 100644 --- a/base/.config/profile/profile.d/base.sh +++ b/base/.config/profile/profile.d/base.sh @@ -1,5 +1,20 @@ #ft=sh +alias slugify="sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z" + +source_env_file () { + file="${1}" + if [ ! -f "${file}" ]; then + return + fi + eval "$( + grep -v '^\s*\#' "${file}" | + grep -v '^\s*$' | + sed 's/^\s*export//g' | + sed 's/^/export /g' + )" +} + add_date_prefix () { DIR=$(dirname "$1") FILE=$(basename "$1") diff --git a/base/.config/zsh/zshrc.d/base.zsh b/base/.config/zsh/zshrc.d/base.zsh index 78b451b..efdfa4d 100644 --- a/base/.config/zsh/zshrc.d/base.zsh +++ b/base/.config/zsh/zshrc.d/base.zsh @@ -4,6 +4,10 @@ setopt pushdignoredups setopt histignorealldups setopt sharehistory +setopt INC_APPEND_HISTORY +setopt HIST_IGNORE_DUPS +setopt EXTENDED_HISTORY + # Use emacs keybindings even if our EDITOR is set to vi bindkey -e diff --git a/base/.profile b/base/.profile index bedc6d7..82f8f2d 100644 --- a/base/.profile +++ b/base/.profile @@ -10,7 +10,7 @@ export XDG_CACHE_HOME=${XDG_CACHE_HOME:="$HOME/.cache"} export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"} export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"} -env_file() { +env_file () { file="${1}" if [ ! -f "${file}" ]; then return