Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made searching commands for .always_forget.txt #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 38 additions & 34 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,22 @@ alias weather='curl http://wttr.in/ann_arbor?Tn1'
alias weather3='curl http://wttr.in/ann_arbor?Tn | less'
alias vboxmanage=VBoxManage
alias gg='grep -r . --binary-files=without-match --exclude-dir ".git" --exclude "*~" -e'
function raf(){
grep "$@" ~/.always_forget.txt
}
alias raff="cat .always_forget.txt | fzf"
function ff() {
find . \
-iwholename '*'$*'*' \
-not -iwholename '*/env/*' \
-not -iwholename '*/venv/*' \
-not -iwholename '*/node_modules/*' \
-not -iwholename '*/__pycache__*' \
-not -iwholename '*/tmp*' \
-not -iwholename '*.cache*' \
-not -path '*/\.*' \
-iwholename '*'$*'*' \
-not -iwholename '*/env/*' \
-not -iwholename '*/venv/*' \
-not -iwholename '*/node_modules/*' \
-not -iwholename '*/__pycache__*' \
-not -iwholename '*/tmp*' \
-not -iwholename '*.cache*' \
-not -path '*/\.*' \
;
}
}
alias fb="find . -name '*~'"
alias fbrm="find . -name '*~' -exec rm -v {} \;"
alias pylint='pylint --output-format=colorized'
Expand Down Expand Up @@ -108,28 +112,28 @@ fi
### Path stuff ################################################################
# remove item from $PATH
path-remove () {
local IFS=':'
local NEWPATH
for DIR in $PATH; do
if [ "$DIR" != "$1" ]; then
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
fi
done
export PATH=${NEWPATH};
local IFS=':'
local NEWPATH
for DIR in $PATH; do
if [ "$DIR" != "$1" ]; then
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
fi
done
export PATH=${NEWPATH};
}

# add item to end of $PATH, uniquely
path-append () {
[ -d $1 ] || return 1 # make sure directory exists
path-remove $1 # remove the directory
export PATH=${PATH}:${1} # append the directory
[ -d $1 ] || return 1 # make sure directory exists
path-remove $1 # remove the directory
export PATH=${PATH}:${1} # append the directory
}

# add item to beginning of $PATH, uniquely
path-prepend () {
[ -d $1 ] || return 1 # make sure directory exists
path-remove $1 # remove the directory
export PATH=${1}:${PATH} # append the directory
[ -d $1 ] || return 1 # make sure directory exists
path-remove $1 # remove the directory
export PATH=${1}:${PATH} # append the directory
}

path-append /usr/local/bin
Expand Down Expand Up @@ -263,18 +267,18 @@ function find_git_context() {
}

function ps1_context {
# For any of these bits of context that exist, display them and append
# a space. Ref: https://gist.github.com/datagrok/2199506
VIRTUAL_ENV_BASE=`basename "$VIRTUAL_ENV"`
# For any of these bits of context that exist, display them and append
# a space. Ref: https://gist.github.com/datagrok/2199506
VIRTUAL_ENV_BASE=`basename "$VIRTUAL_ENV"`
find_git_context
for v in "${GIT_CONTEXT}" \
"${debian_chroot}" \
"${VIRTUAL_ENV_BASE}" \
"${GIT_DIRTY}" \
"${PS1_CONTEXT}"; do
echo -n "${v:+$v }"
done
}
for v in "${GIT_CONTEXT}" \
"${debian_chroot}" \
"${VIRTUAL_ENV_BASE}" \
"${GIT_DIRTY}" \
"${PS1_CONTEXT}"; do
echo -n "${v:+$v }"
done
}

# Fancy Prompt
source ~/.bashrc_colors
Expand Down