Commits

Woojong Koh  committed 16b954e

Create UpdateTags() function and modify some CtrlP settings

  • Participants
  • Parent commits e739e61

Comments (0)

Files changed (3)

 15ae319e069c7773726ca26516e46b8cb4084ec7 .hgext/hgbb
 244a50c40d93873006c875c5d2ae64fcbc987216 .hgext/hgshelve
-eb6b95a96468d59aedec1927743cc1211b099a3c .hgext/mercurial_keyring
+09e6c343a6bc597559abb669a261b5d138c9a9dc .hgext/mercurial_keyring
 30bdbd5f6173041fa3e8726195dc21f8fd6082ea .hgext/onsub
-25a9cddc2191a1c6751d1e385389c0787a597a3e .oh-my-zsh
+73f777053725ce61d6fada67ff3f174130dd8c94 .oh-my-zsh
 ca0ce8fcc49a09eca7eb8ff8003554de2f250901 .vim/bundle/DirDiff.vim
 698e0c333c1edae8a1d83b04e5674efa7cac3137 .vim/bundle/NrrwRgn
 2cbe946206ec622d9d8cf2c99317f204c4d41885 .vim/bundle/a.vim
 9895285042a2fd5691b2f6582aa979e4d1bdffea .vim/bundle/ack.vim
-3c6182371db8e8ede3789d21b52386569eda2208 .vim/bundle/ctrlp.vim
+be5842a376f16c16c5dc4cc1879d7168a074f7de .vim/bundle/ctrlp.vim
 1e5658c6d9575cd34be32d0227e06f07c9d58a2e .vim/bundle/grep.vim
 8c570a493d260890242cbdc5a22d8500dc4604cb .vim/bundle/gundo.vim
 a1433c485eb254838c1db52e087d5ec4d1e77cfd .vim/bundle/nerdtree
 e877c7e3e249e5784fcee8feaff7f1a8799335a1 .vim/bundle/python-mode
 f5a75d075d3c005ebe69e3f5e56cf99516e8aa3b .vim/bundle/snipmate.vim
-a71048daacca28d2acceb0a3281ffee35187a9ad .vim/bundle/syntastic
-2fee7677d5d46419570cd9760c58192dfba68113 .vim/bundle/tagbar
+2ad1437af7224629677231f8830b1ee204b91e40 .vim/bundle/syntastic
+568ef5fd25468a58723b50cf40a48c5dcb46c802 .vim/bundle/tagbar
 53041fbc45398a9af631a20657e109707a455339 .vim/bundle/taglist.vim
 13fe3d8064647e2cdf07e12840108c3f917f5636 .vim/bundle/vim-autocomplpop
 e3d24db7313c1375d3694e48b62c53ed125f6fbf .vim/bundle/vim-buffergator
 dc349bb7d30f713d770fc1fa0fe209e6aab82dc8 .vim/bundle/vim-commentary
 667a668e114e9ec0e5d4cbcb0962d835b23614c4 .vim/bundle/vim-easymotion
 3bb534a720fa762aa01d2df2d5d41bd3c4122169 .vim/bundle/vim-l9
-5e3fdd3a8a3b244e1fedd0f5597f4a9879e16c3b .vim/bundle/vim-pathogen
+96b5726ef3135effd54993e52c773718fb69a95d .vim/bundle/vim-pathogen
 20ab08c9a8fe6cdfb7c303aa3063f211d72f8b2f .vim/bundle/vim-powerline
 78ab4b3df24fa2753d3dfc1be75ed5a3df1565b8 .vim/bundle/vim-smartinput
 02ee85f9624c93a6accf571749dfd7d5e8e2cfab .vim/bundle/vim-yankstack
 set history=1000
 set viminfo+=%3		" Save and restore the buffer list
 set undofile
+set noswapfile
 set clipboard=unnamed
 if has('unnamedplus')
     set clipboard=unnamedplus
 autocmd BufEnter *.tex silent! setlocal textwidth=75 spell spelllang=en_us
 autocmd BufReadPre,BufNewFile SConstruct,Sconscript set filetype=python
 autocmd BufEnter * if filereadable('SConstruct') || filereadable('SConscript') | silent! setlocal makeprg=scons\ -u | else | silent! setlocal makeprg= | endif
+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:tags_list = findfile("tags", ".;", -1)
+    if len(l:tags_list) > 1
+        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)&'
+    endif
+endfunction
+
 autocmd VimResized * :wincmd =  " Resize splits when the window is resized
 
 " http://vim.wikia.com/wiki/Automatically_open_the_quickfix_window_on_:make
 
 " CtrlP
 set wildignore+=*.o,*.obj,.DS_Store	" Linux/MacOSX
-let g:ctrlp_custom_ignore = '\v[\/](\.git|\.hg|\.svn)$'
+let g:ctrlp_cmd = 'CtrlPMixed'
+let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
 let g:ctrlp_reuse_window = 'netrw\|help\|quickfix\|nerdtree'
 let g:ctrlp_user_command = {
                 \ 'types': {
 if [ -f ~/Dropbox/Mac\ Sync/.hostnames ]; then
     source ~/Dropbox/Mac\ Sync/.hostnames
 fi
+
+# MATLAB
+alias matlab="/Applications/MATLAB_R2011b.app/bin/matlab -nodesktop -nosplash"