mirror of
https://github.com/prurigro/darkcloud-vimconfig.git
synced 2024-11-22 06:44:09 -05:00
22 lines
670 B
Bash
Executable file
22 lines
670 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
TAGS_FILE="${HOME}/.vim/tags"
|
|
CTAGS_CMD="ctags --fields=+l --c-kinds=+p --c++-kinds=+p -R -f ${TAGS_FILE}"
|
|
|
|
function generate_tags(){
|
|
echo -e "\nRecursively generating tags for the following paths:"
|
|
for path in "$@"; do
|
|
echo " ${path}"
|
|
done
|
|
RESULT=$($CTAGS_CMD "$@" >/dev/null 2>&1) && echo -e "Done!\n" || echo -e "Failed! Look at ${TAGS_FILE}.log for details.\n"
|
|
if [[ -n "$RESULT" ]]; then
|
|
echo "$RESULT" >> "${TAGS_FILE}.log"
|
|
fi
|
|
}
|
|
|
|
if [[ $(type -P ctags) ]]; then
|
|
[[ -n "$1" ]] && generate_tags "$@" || generate_tags "$PWD"
|
|
else
|
|
echo 'Error: cannot find the ctags binary in $PATH'
|
|
exit 1
|
|
fi
|