public
Last active

Generate tags files for all of the non-hidden directories under the current directory.

  • Download Gist
projtags.sh
Shell
1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh
 
start=$(pwd)
 
for f in $(find . \( ! -regex '.*/\..*' \) -type d); do
cd $f
ctags *
cd $start
done
 
ctags --file-scope=no -R
updatetags.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/bash
 
start=$(pwd)
 
# Generate tags files in directories where "tags" is not the newest file
for f in $(find . -type f -newer ./tags); do
cd $f
ctags *
cd $start
done
 
# Generate tags files in directories with no tags files where the parent
# directory does have a tags file. Ignore hidden directories.
for f in $(find . -type d \( ! -regex '.*/\..*' \) \! -exec test -e '{}/tags' \; -print); do
if [ -e ${f}/../tags ]; then
cd $f
ctags *
cd $start
fi
done

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.