EragonJ – A humble navigator

About EragonJ | About this blog

Archive for the ‘Vim’ tag

[RoR] 幹

leave a comment

為了這個東西,我不知道死了多少腦細胞,


一開始為了yml的問題,我不知道搞了多久,最後發現是Vim設定上沒有設好,導致RoR一直出錯,再來就是因為64bit和32bit的問題,因為「the Ruby interpreter bundled in XCode 3.0 is in fact only compiled as a 32-bit i386 executable」,很好,我用我的64bit版本的Mysql,就因為這樣死在這邊,GOOD。


最後把Mysql換回32bit,好棒,RoR終於可以讀Mysql的資料了耶~我的所有資料庫資料也因此全部消失了,耶~中間也花了好幾個禮拜的時間搞書和安裝設定一大堆相容性的問題,版本的差異也是個大問題,時間都不用錢的,超棒。

重要文章Link1
重要文章Link2



結論,為了這個RoR,我覺得,「得不償失」,幹。

Written by EragonJ

February 12th, 2010 at 2:57 pm

Posted in RoR,Vim

Tagged with , , , , ,

[vim] My Vimrc

leave a comment

因為受c9s的影響所以也走上了玩vim的不歸路,但是沒想到還真的是蠻好玩的。所以來分享一下現在的vimrc。

Download

會持續更新,直到把整個vim調教(?)的很完整為止XD~

§2010/03/05更新,把它放在我github的帳號下,以後要維護就比較方便了。

Written by EragonJ

November 19th, 2009 at 6:40 pm

Posted in Vim

Tagged with , , ,

[MAC] vi setting , ls color and alias

leave a comment

今天一個下午都一直在練習用command line的方式去設定一些東西,現在來報告一下今天研究的結果:

1. vi setting:
因為之前一直看到很多人在用vi/vim來開發程式,所以一定要來學一下,因為他有很多很方便的功能可以讓我們輕易上手,提供我們更高的便利性去design a program。因為MAC是based on Darwin 而且有部分的東西是從FreeBSD來的,所以設定的方法和他們一樣。

因為我不想要去動到core的資料,所以從flexibility的角度來說,我希望每個設定是獨立且不會受到影響的,而前輩們早就想到這些東西,就提供了一個方法,可以在不同user的家目錄下這個指令:


vi .vimrc

去設定vi提供的一個user defined的檔案,在這個檔案內做設定,像我就設定成這樣:


syntax on
hi Comment ctermfg = Green
set hlsearch
set expandtab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set cindent
set autoindent
set number

主要是要開啟syntax color,因為打開才看的下去,要不然他原本都是白色的字,看了很難過…我是看不下去啦= =” 所以就改下去了,而hlsearch是對search的結果做highlight的動作,而set number則是顯示行號,其他的就是一些tab寬度、縮排的設定,有需要再自己去找一下相關的設定。

2,3 alias and ls color
alias 在 Yahoo Dictionary 的意思就是:

n. (名詞 noun)
化名;別名
ad. (副詞 adverb)
別名叫;化名為

所以就是可以把已知指令用更簡單的方式來表示,所以我們可以在家目錄找到.profile,就vi它吧!

vi .profile


alias ll="ls -al"
export CLICOLOR=1
export LSCOLORS=dxfxcxdxbxegedabagacad

這邊要注意的就是ailas的等號旁邊是不能有space的,有的話會出問題。而根據FreeBSD `ls’: Colour-coded directory/file listing(s)這篇文章所講的,只要用export CLICOLOR=1,這樣就可以開啟顏色的功能,不過也是可以用 alias ls=”ls -G”,同樣可以達到我們要的效果

The color designators are as follows:
a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background
Note that the above are standard ANSI colors. The actual display may differ depending
on the color capabilities of the terminal in use.

The order of the attributes are as follows:

1. directory
2. symbolic link
3. socket
4. pipe
5. executable
6. block special
7. character special
8. executable with setuid bit set
9. executable with setgid bit set
10. directory writable to others, with sticky bit
11. directory writable to others, without sticky bit

The default is “exfxcxdxbxegedabagacad”,
for regular directories, black foreground and red background for setuid executables,
etc.

大概就是這樣,看還有想到什麼再來補上!

δ 最新的文章,有為MAC OSX 設計的LS color Picker,有興趣的朋友可以用用看並給我一些建議:P~

Written by EragonJ

April 18th, 2009 at 9:58 am

Posted in OS

Tagged with , , , ,