Skip to content

Instantly share code, notes, and snippets.

@latortuga
Created November 3, 2011 17:32
Show Gist options
  • Select an option

  • Save latortuga/1337126 to your computer and use it in GitHub Desktop.

Select an option

Save latortuga/1337126 to your computer and use it in GitHub Desktop.
tag generator
#! /usr/bin/env bash
FILE_TAGS_NAME='ftags'
echo '!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/' > $FILE_TAGS_NAME
echo '!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_NAME Exuberant Ctags //' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_VERSION 5.7 //' >> $FILE_TAGS_NAME
find $* \
\( \
-name '.DS_Store' -or \
-name '.tmp_*~' -or \
-name '*.pdf' -or \
-name '*.jpg' -or \
-name '*.png' -or \
-name '*.swf' -or \
-name '*.gif' -or \
-name '*.ico' -or \
-name '*.swp' -or \
-name '*.swd' -or \
-name '.gitkeep' -or \
-name '*.swo' \
\) -prune -or \
\( \
-path '*/.svn/*' -or \
-path '*/.git/*' -or \
-path '*/tmp/*' -or \
-path '*/performance/*' -or \
-path '*/coverage/*' -or \
-path '*/.bundle/*' -or \
-path '*/tiny_mce/*' -or \
-path '*/jquery-ui-*.custom/*' \
\) -prune -or \
-type f -print | \
ruby -nle 'puts %Q{#{$_[2..-1]}\t#{$_}\t#{%q{/^/;"}}\tr}' | \
sort >> $FILE_TAGS_NAME
#ruby -nle 'puts %Q{#{File.basename($_)}\t#{$_}\t#{%q{/^/;"}}\tr}' | \
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment