Macros in Vim

I don’t know how to quit vim so I am destined to use it forever. Let’s make the usage a little less painful.
Read more →

Silent pushd and popd in Bash Scripts

I have several shell scripts that use pushd and popd extensively. These commands output the paths to stdout which may overwhelm the console output with lots of unwanted text. Unfortunately, neither pushd nor popd have any silent option according to their man pages. A simple solution is to redirect the stdout to /dev/null. pushd $PWD > /dev/null Is it favourable to explicitly redirect to /dev/null everytime I call pushd/popd in the script?
Read more →

Find All Directories

I needed to go through a directory structure and do a git-fetch if there was a .git repository inside. Finding all directories containing the .git is quite easy with find command. find $root-directory -regex '^.*/.git$' -printf '%h\n' | sort -d This is nice but it also prints unneccesary data. It does not only print the leaf directories but also all the partial paths to them. The original project structure is something like:
Read more →