Earlier quoted context omitted.
> tree I agree, tree is great. It can be somehow replicated by using "find .", if you are in a hurry. > bat If you need that functionality, why don't you open the file with vim, for example? > rg - better grep Grep is pretty nifty, I don't see how could it be improved. What is the main advantage of of rg over grep? > direnv - local environment variables I read the manpage for direnv and I was really scared. What is i…
direnv is super useful if you're working in Python and have multiple projects: you can add an .envrc file that activates the right virtualenv whenever you enter a directory. It's one less thing to worry about. I figure you can also use it in conjunction with `module load` to automatically load the right module when you enter a project's directory. Modules are used in many computing clusters to manage environments. Al…
function lenv {
path=$PWD
while [[ ! -f "$path/.env" && "$path" != '/' ]]; do
path=$(dirname "$path")
done
if [ -f "$path/.env" ]; then
source "$path/.env"
fi
}
function cd { builtin cd "${@}"; lenv; }It lacks the security but it works recursively and allows more than just environment variables. A common script I have is to automatically build for instance:
here=$(dirname ${BASH_SOURCE[0]})
function autobuild {
(
mkdir -p build
cd $here/build
../configure
while true; do
make && make check
inotifywait -qr -e close_write,delete $here/src $here/test $here/Makefile.am
done
)
}
I've tried generalizing the latter but between different targets, different build systems, different projects structures etc, copy and pasting something like this per project is the least worst option.