Skip to content

Instantly share code, notes, and snippets.

@kofrasa
Last active June 14, 2017 09:49
Show Gist options
  • Save kofrasa/42036f622fdd5d375682ada8864166d3 to your computer and use it in GitHub Desktop.
Save kofrasa/42036f622fdd5d375682ada8864166d3 to your computer and use it in GitHub Desktop.
Generate ctags for a project

Small function to generate tags file for your project

tags_init() {
  local root=$(pwd)
  local cmd="ctags -R -o .tags"
  for d in src test tst $*; do
    if [ -d "$root/$d" ]; then
      cmd="$cmd $d"
    fi
  done
  echo $cmd | sh 2>/dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment