summaryrefslogtreecommitdiffstats
path: root/.bashrc
diff options
context:
space:
mode:
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc73
1 files changed, 2 insertions, 71 deletions
diff --git a/.bashrc b/.bashrc
index 2212fee..dff2018 100644
--- a/.bashrc
+++ b/.bashrc
@@ -32,77 +32,6 @@ local_pathmunge () {
}
local_pathmunge ~/usr/local/bin
-# Change to the correct sibling of a parent directory
-cd_parent_sibling ()
-{
- local sibling_name="$2";
- local curname="";
- local curtop="$PWD";
- local finaltop=""
- while [ ! "$curtop" = "/" ]; do
- if [ -d $(dirname $curtop)/$sibling_name ]; then
- finaltop=$(dirname $curtop)/$sibling_name;
- break;
- fi
- curname=$(basename $curtop)/$curname;
- curtop=$(dirname $curtop);
- done
- if [ ! -z "$finaltop" ]; then
- if [ ! -z "$3" ]; then
- if [ ! -d $finaltop/$curname ]; then
- echo "$finaltop found but $finaltop/$curname not found";
- fi
- finaltop=$finaltop/$curname;
- fi
- if [ -d $finaltop ]; then
- echo "$1 $finaltop"
- $1 $finaltop
- fi
- else
- echo "parent directory with sibling $sibling_name not found"
- fi
-}
-
-# Change to build directory
-cdb ()
-{
- if [ -z "$1" ]; then
- cd_parent_sibling cd build t;
- else
- cd_parent_sibling cd "$1" t;
- fi
-}
-
-# Change to source directory
-cds ()
-{
- if [ -z "$1" ]; then
- cd_parent_sibling cd source t;
- else
- cd_parent_sibling cd "$1" t;
- fi
-}
-
-# Push to top of build directory
-cdbt ()
-{
- if [ -z "$1" ]; then
- cd_parent_sibling pushd build;
- else
- cd_parent_sibling pushd "$1";
- fi
-}
-
-# Push to top of source directory
-cdst ()
-{
- if [ -z "$1" ]; then
- cd_parent_sibling pushd source;
- else
- cd_parent_sibling pushd "$1";
- fi
-}
-
# An emacs 'alias' with the ability to read from stdin; example:
# echo "hello world" | ef -
ef()
@@ -144,6 +73,8 @@ case "$-" in
source_first /usr/share/fzf/shell/key-bindings.bash ~/.fzf.bash
eval "$(~/usr/local/bin/fasd --init auto)"
complete -d j
+ eval "$(direnv hook bash)"
+ source ~/usr/local/bin/commacd.sh
# Emacs tramp wants a simple prompt that it can recognize
if [[ "$TERM" = "dumb" ]]; then