From f0bd1541d720be95055d4a4596d19aa14f2663fb Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Thu, 21 Jan 2021 21:17:18 -0800 Subject: [PATCH] move slugify alias to profile --- base/.config/bash/bashrc.d/aliases.sh | 1 - base/.config/profile/profile.d/base.sh | 15 +++++++++++++++ base/.config/zsh/zshrc.d/base.zsh | 4 ++++ base/.profile | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) 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