Permalink
Browse files

ctags

  • Loading branch information...
Tyler Ball
Tyler Ball committed Apr 9, 2012
1 parent d7733bd commit edd9c33b662df3f66e21acf5677ed8ecd89484ae
Showing with 22 additions and 0 deletions.
  1. +8 −0 _ctags
  2. +3 −0 _vimrc
  3. +5 −0 _zsh/zsh_aliases
  4. +6 −0 install.sh
View
8 _ctags
@@ -0,0 +1,8 @@
+ngdef=js
+--langmap=js:.js
+--regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\{/\1/,object/
+--regex-js=/([A-Za-z0-9._$()]+)[ \t]*[:=][ \t]*function[ \t]*\(/\1/,function/
+--regex-js=/function[ \t]+([A-Za-z0-9._$]+)[ \t]*\(([^)])\)/\1/,function/
+--regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\[/\1/,array/
+--regex-js=/([^= ]+)[ \t]*=[ \t]*[^"]'[^']*/\1/,string/
+--regex-js=/([^= ]+)[ \t]*=[ \t]*[^']"[^"]*/\1/,string/
View
3 _vimrc
@@ -189,6 +189,9 @@
nnoremap n nzzzv
nnoremap N Nzzzv
+ " tags file
+ set tags+=$HOME/.vimtags/tags
+
" }}}
" Formatting {{{
set expandtab "" converts tab keypresses to spaces
View
@@ -49,3 +49,8 @@
alias gt="git st"
alias gpl="git pull"
+
+# ctags
+ alias gentags='ctags-exuberant -f ~/.vimtags/tags -h ".js" --totals=yes --tag-relative=yes --fields=+akst -R'
+
+[[ -f /usr/local/bin/brew ]] && alias ctags-exuberant="ctags"
View
@@ -26,4 +26,10 @@ if [ ! -d "$HOME/.vimswap/" ]; then
mkdir ~/.vimswap/backup
fi
+if [ ! -d "$HOME/.vimtags/" ]; then
+ echo "creating vimtags dir"
+ mkdir ~/.vimtags
+ touch ~/.vimtags/tags
+fi
+
echo "Done!"

0 comments on commit edd9c33

Please sign in to comment.