Created
October 8, 2019 14:19
-
-
Save chriscauley/3784ee0a71609344c0dd55ec05419153 to your computer and use it in GitHub Desktop.
Loop through files and open sequentially in emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in .bash_aliases or .bashrc | |
# USAGE: | |
# eemacs a.py b.py c.py | |
# eemacs `grep SomeClass * -rl` | |
# grep SomeClass * -rl | grep -v migrations | grep models.py > SOME_CLASS | |
# eemacs `cat SOME_CLASS` | |
function eemacs { | |
DNE=() | |
for FILE in $*; | |
do | |
if test -f "$FILE" | |
then emacs $FILE; | |
else DNE+=($FILE) | |
fi | |
done | |
for FILE in $DNE; | |
do | |
echo "Missing: $FILE" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment