Commits

Woojong Koh  committed 617b006

Refactor UpdateTags() function

  • Participants
  • Parent commits 16b954e

Comments (0)

Files changed (2)

 autocmd BufWritePost,FileWritePost * silent! call UpdateTags()
 
 function UpdateTags()
-    execute "!(cd ". expand("%:p:h") . ";ctags --sort=foldcase --c++-kinds=+p --fields=+iaS --extra=+q *)&"
+    let l:ctags_options = "--sort=foldcase --c++-kinds=+p --fields=+iaS --extra=+q"
+    let l:ctags_excludes = '--exclude="*/typeof/*" --exclude="*/preprocessed/*"'
+
+    execute "!(cd ". expand("%:p:h") . ";ctags ". l:ctags_options ." *)&"
 
     let l:tags_list = findfile("tags", ".;", -1)
     if len(l:tags_list) > 1
+        let l:tmpfile = tempname()
         let l:globaltags_path = fnamemodify(l:tags_list[-1], ":p:h")
-        let l:tmpfile = tempname()
-        execute "!(cd ". l:globaltags_path .';ctags --sort=foldcase --c++-kinds=+p --fields=+iaS --extra=+q --exclude="*/typeof/*" --exclude="*/preprocessed/*" -f '. l:tmpfile .' --file-scope=no -R; mv '. l:tmpfile .' tags)&'
+        execute "!(cd ". l:globaltags_path .";ctags ". l:ctags_options ." ". l:ctags_excludes ." -f ". l:tmpfile ." --file-scope=no -R; mv ". l:tmpfile ." tags)&"
     endif
 endfunction
 

File bootstrap_mac.sh

 
 # Install libraries
 sudo port install glew
-sudo port install jpeg
-sudo port install freetype
+#sudo port install jpeg
+#sudo port install freetype
 
 # Install MacVim