diff --git a/zsh/func/refresh_system_tags b/zsh/func/refresh_system_tags new file mode 100644 index 0000000..dbee405 --- /dev/null +++ b/zsh/func/refresh_system_tags @@ -0,0 +1,34 @@ +#!/usr/bin/env zsh + +. $HOME/.shell-functions + + +TAGS_DIR=$HOME/.tags + + +function refresh_system_tags +{ + if [[ "$SYS" == "darwin" ]]; then + print_info "Refreshing Apple frameworks in /System/Library/Frameworks" + find /System/Library/Frameworks -maxdepth 2 -name Headers \ + -exec ctags -Ra -f "$TAGS_DIR/apple_frameworks.tags" {} \; + + print_info "Refreshing 3rd party frameworks in /Library/Frameworks" + find /Library/Frameworks -maxdepth 2 -name Headers \ + -exec ctags -Ra -f "$TAGS_DIR/3rdparty_frameworks.tags" {} \; + fi + + # Generic UNIX system include directory + if [[ -d /usr/include ]]; then + print_info "Refreshing system includes in /usr/include" + ctags -Ra -f "$TAGS_DIR/usr.tags" /usr/include + fi + + # Generic UNIX local system include directory + if [[ -d /usr/local/include ]]; then + print_info "Refreshing local system includes in /usr/local/include" + ctags -Ra -f "$TAGS_DIR/usr_local.tags" /usr/local/include + fi +} + +refresh_system_tags diff --git a/zshrc b/zshrc index 1bd2da9..0c4dee7 100644 --- a/zshrc +++ b/zshrc @@ -91,6 +91,9 @@ function configure_modules_and_functions #{{{ print_info -l 3 "Loading pw module" autoload pw + + print_info -l 3 "Loading refresh_system_tags" + autoload refresh_system_tags } #}}}