# note.
## copy bash completion
-# Usage: ORIGINAL_COMMAND TARGET_COMMAND...
#
# It copies how the bash completion works from one command to other
-# commands.
+# commands. Generally just use within a .bashrc.
+#
+# Usage: ORIGINAL_COMMAND TARGET_COMMAND...
+#
ccomp() {
local c src
src=$1
eval $c $*
}
-## BEGIN directory history tracking and navigation.
+## BEGIN functions to change directory better than cd ##
+#
+# The functions:
#
-# use c instead of cd (could alias to cd if you wanted). b to go back, f
-# to go forward, cl to list recent directories and choose one.
+# c: acts like cd, but stores directory history: you could alias to cd if you wanted.
+# b: go back
+# f: go forward
+# cl: list recent directories and optionally choose one.
#
-# The finer details you may want to skip:
+# Finer details you may want to skip:
#
-# We also define bl to print the list of back and forward directories.
+# bl: print the list of back and forward directories.
#
-# We keep 2 stacks, forward and back. Unlike with a web browser, the
-# forward stack is not erased when going somewhere new.
+# We keep 2 stacks of directories, forward and back. Unlike with a web
+# browser, the forward stack is not erased when going somewhere new.
#
# Recent directories are stored in ~/.cdirs.
#
# printf "%s\n" "${_dir_forward[-1]}"
# fi
}
-# cd list
+# cl = cd list
cl() {
local i line input start
local -A buttondirs alines
c "${buttondirs[$input]}"
fi
}
-# list the back and forward directories. i tend to forget this exists
-# and use cl instead.
+# bl = back list. lists the back and forward directories. i tend to
+# forget this exists and use cl instead.
bl() {
local start i j max
max=10
fi
done
}
+## BEGIN functions to change directory better than cd ##
# pee do. run args as a command with output copied to syslog.
#