Create Fake “Install OS X Mountain Lion.app" for use with Unibeast from InstallESD.dmg

Unibeast needs Install Mac OS X Mountain Lion.app inside the /Applications folder.

But what if I only have InstallESD.dmg ?

Below is what I did. In Terminal.app, do:


$ cd /Applications
$ mkdir -p "Install OS X Mountain Lion.app/Contents/SharedSupport"
$ cp InstallESD.dmg "/Applications/Install OS X Mountain Lion.app/Contents/SharedSupport/"

Then open Unibeast, it should pick up InstallESD.dmg.

When Unibeast installs to my flash drive, The estimated time goes up to whopping 7hrs. I opened Disk Utility.app to see the used space of the flash drive, it was increasing. So I ignored the estimated time. At last the installation time did end up in about 5 minutes.

vim-css-color 很慢

裝了 vim-css-color 這個外掛之後就發現 vim 啓動變得很慢,大約需要 1~3 秒,但是只有在開 .css 檔案的時候纔會發生。

讀了 http://vim.1045645.n5.nabble.com/Slow-vim-loading-how-to-find-it-out-td3309308.html 但是我的 --startuptime 參數不能用,就用接下來他提供的方法來測量啓動時間:

vim --cmd 'profile start profile.log' \
--cmd 'profile func *' \
--cmd 'profile file *' \
-c 'profdel func *' \
-c 'profdel file *' \
-c 'qa!' <filename>

我在 profile.log 當中找到這麼一段:

FUNCTION 60_pow()
Called 227970 times
Total time: 1.652021
Self time: 1.652021
count total (s) self (s)
227970 0.342732 let x = a:x
227970 0.588432 for i in range(a:n-1)
227970 0.315352 let x = x*a:x
227970 0.170424 return x

雖然不太清楚這段本意是要做什麼,不過我也看得出來這是一個跑了很多次的迴圈。

把 source code 一小段丟去 google 搜尋,果然就是 vim-css-color 的 code ,幸運的是,看起來已經有人有 patch (還有一個 pull request ),可是這個 pull request 最終沒有被 merge 回原作者的版本 (skammer)

試着想要換成 ap 的版本 但是卻又遇到了一點問題……