Commits

Woojong Koh committed e8fef2b

Clean up .vimrc and update scripts

  • Participants
  • Parent commits 9329cd5

Comments (0)

Files changed (6)

 # use glob syntax.
 syntax: glob
 
+.DS_Store
 tags
 
 .vim/tmp/
 c4e9bcb9f9e7af74b2f5e6d4f5afb33c6ad78dfc .hgext/hgshelve
 db9e7c92b31527e0d8cd595a1b7d9af727bc2d17 .hgext/mercurial_keyring
 30bdbd5f6173041fa3e8726195dc21f8fd6082ea .hgext/onsub
-90c28b786ae8a8013fc5083e9cf941115152c706 .oh-my-zsh
+e30a1243dc89814e9f31e4b4cc284d948ecbfbd8 .oh-my-zsh
 ca0ce8fcc49a09eca7eb8ff8003554de2f250901 .vim/bundle/DirDiff.vim
 06c1e16a4dcfd1b8b1764e96482af4b063ca7c8a .vim/bundle/MatlabFilesEdition
 de27db45830cb7b24ac9606c22fe36b37136665b .vim/bundle/NrrwRgn
 543be33b13756eabc02cd91ef141c1d3fb216446 .vim/bundle/delimitMate
 852ddb0c6590bbc41c508d7f5d2fc17112492def .vim/bundle/grep.vim
 eb9fc8676b8959c3c2c95bf6b6e8f0f44317c5c0 .vim/bundle/gundo.vim
-c7662c1d8bd501c2c86d0432bbe22be7e591bb18 .vim/bundle/neocomplcache.vim
+da44ba4a92eef3860bdee2d96d755a7171889a70 .vim/bundle/neocomplcache.vim
 b0bb781fc73ef40365e4c996a16f04368d64fc9d .vim/bundle/nerdtree
 efc6100a7d5155dc112ed828fb83d8568aec36e7 .vim/bundle/python-mode
 f5a75d075d3c005ebe69e3f5e56cf99516e8aa3b .vim/bundle/snipmate.vim
-fd79a1718902f3eee78a40547d9a792b0e54927f .vim/bundle/tagbar
+207b8520c27c67ad9e2c91534c0ae2d44efe0c92 .vim/bundle/tagbar
 a761d9f780b7fe29dc7f717d3852d35204147ab5 .vim/bundle/vim-buffergator
 528a59f26d12278698bb946f8fb82a63711eec21 .vim/bundle/vim-colors-solarized
 a3ae0df1d9e13941e9e8086637055841ce93f7bd .vim/bundle/vim-commentary
 "------------------------------------------------------------
 
 " Customization
+set textwidth=80
 set infercase
 set shiftround
 set nonumber
 
 " Autocommand
 autocmd BufEnter * silent! lcd %:p:h
-autocmd BufEnter *.tex silent! setlocal textwidth=75 spell spelllang=en_us
+autocmd VimResized * :wincmd =  " Resize splits when the window is resized
+
 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 VimResized * :wincmd =  " Resize splits when the window is resized
-"autocmd BufWritePost,FileWritePost * call UpdateTags()
+autocmd BufEnter * if filereadable('SConstruct') || filereadable('SConscript') | silent! setlocal makeprg=scons\ -U | else | silent! setlocal makeprg= | endif
+autocmd BufEnter *.tex silent! setlocal spell spelllang=en_us
 
-function UpdateTags()
-    if !filereadable('tags')
-        return
-    endif
-
-    let l:ctags_options = "--sort=foldcase --c++-kinds=+p --fields=+iaS --extra=+q"
-    let l:ctags_excludes = '--exclude="*/typeof/*" --exclude="*/preprocessed/*"'
-
-    silent! 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")
-
-        if l:globaltags_path == $HOME
-            if len(l:tags_list) > 2
-                let l:globaltags_path = fnamemodify(l:tags_list[-2], ":p:h")
-            else
-                return
-            endif
-        endif
-
-        silent! 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
 
 " http://vim.wikia.com/wiki/Automatically_open_the_quickfix_window_on_:make
 " Automatically open, but do not go to (if there are errors) the quickfix /

File bin/bootstrap_linux.sh

 $APT_GET install libboost-dev || exit
 $APT_GET install libfreetype6-dev || exit
 $APT_GET install libglew-dev || exit
+$APT_GET install libglfw-dev || exit
 $APT_GET install libjpeg-dev || exit
 $APT_GET install liblapack-dev || exit
 $APT_GET install libncurses-dev || exit

File bin/bootstrap_mac.sh

 sudo port install ccache || exit
 sudo port install coreutils || exit
 sudo port install ctags || exit
-sudo port install ffmpeg || exit
+sudo port install x264 +asm ffmpeg || exit
 sudo port install git-core || exit
 sudo port install htop || exit
 sudo port install meld || exit
 sudo port -ns install boost configure.compiler=macports-gcc-4.8 || exit
 sudo port install freetype || exit
 sudo port install glew || exit
+sudo port install glfw || exit
 sudo port install glm || exit
 sudo port install jpeg || exit
 sudo port install libpng || exit

File bin/encode_imgs_to_vid.py

                         action='store_false', help='create a vertical side by side video')
     parser.add_argument('-f', '--frame_rate', type=int, default=DEFAULT_FRAME_RATE,
                         help='frame rate', metavar='R')
-    parser.add_argument('-t', '--threads', type=int, default=multiprocessing.cpu_count() // 2 + 1,
-                        help='the number of threads to use', metavar='N')
+    parser.add_argument('-t', '--threads', type=int,
+            default=multiprocessing.cpu_count() // 2 + 1,
+            help='the number of threads to use', metavar='N')
     parser.add_argument('-b', '--baseline', action="store_true",
                         help='use the Baseline Profile for better compatibility')
     args = parser.parse_args()
         opts += ['-i', f]
 
     # Merge options (Overlay)
-    if len(args.img_files) == 2:
-        if args.horizontal_sxs:
-            opts += ['-filter_complex', '[0:0]pad=iw*2:ih[a];[a][0:1]overlay=w:0']
-        else:
-            opts += ['-filter_complex', '[0:0]pad=iw:ih*2[a];[a][1:0]overlay=0:h']
+    n_img_files = len(args.img_files)
+    if n_img_files > 1:
+        pad = '[0:0]pad=iw*%d:ih'
+        overlay = '[a];[a][0:%d]overlay=w*%d:0'
+        if not args.horizontal_sxs:
+            pad = '[0:0]pad=iw:ih*%d'
+            overlay = '[a];[a][%d:0]overlay=0:h*%d'
+
+        f = pad % n_img_files
+        for i in range(1, n_img_files):
+            f += overlay % (i, i)
+        opts += ['-filter_complex', f]
 
     # Video options
     opts += ['-y',
              '-r', args.frame_rate,
              '-vcodec', 'libx264',
              '-threads', args.threads,
-             '-preset', 'slow',
-             '-crf', '6',
-             '-pix_fmt', 'yuv420p',
+             '-preset', 'veryslow',
+             '-crf', '18',
+             '-pix_fmt', 'yuv420p',  # for QuickTime
              '-movflags', '+faststart'  # faststart for Web video
              ]
     if args.baseline:
-        opts += ['-profile:v', 'baseline']  # for iMovie and so on
+        opts += ['-profile:v', 'baseline', '-level', '3.0']  # for iMovie and so on
     else:
-        opts += ['-profile:v', 'high', '-level', '4.1']  # iPad >= 2, iPhone >= 4S
+        opts += ['-profile:v', 'high', '-level', '4.0']  # ATV >= 3, iPad >= 2, iPhone >= 4S
 
     # Output file
     opts.append(args.output_file)
                 _err=process_output,
                 _out_bufsize=1,
                 _err_bufsize=1)
+    print 'Run:', p.ran
     p.wait()
+    exit(p.exit_code)