2008年1月13日星期日

RadRails Shortcut

使用RadRails时自定义的一些快捷键,做备忘。

这些快捷键的设定我没有参考其他任何编辑器,只是根据自己的使用,凭感觉,尽量让手不移开键盘的基准位置(ASDF JKL;),尽量使用Alt键(Ctrl键太远了,而且要用小指去按),尽量不用上下左右方向键和Home、End、Page Up、Page Down键(因为要离开基准位置)。
本来很想把Caps Lock键废掉,设置为Ruby Content Assist功能(该功能在TextMate里是Tab键,但在RadRails里Tab键不能再设定其他功能,否则原有制表符功能会废掉),但不知道该怎么设置。其实Tab键是最方便的一个键,退而求其次Caps Lock键也是第二方便的键,遗憾的是这两个键都用不了。
另外很重要的一点就是,在定义新快捷键的同时,原有的常用的快捷键也不应该取消,如Ctrl + Z、Ctrl + Y、Ctrl + X、Ctrl + C、Ctrl + V、Ctrl + S,一是可以给自己过渡,而是跟别人pair programming的时候,不会对你的键盘行为太陌生。
Close All        Alt + B W (custom) or Shift + Ctrl + W
Max/Min Editor Alt + 1 (custom) or Ctrl + 1 (custom)
Open Resource Alt + 2 (custom) or Ctrl + 2 (custom)
Next Editor Alt + 3 (custom)
Search Alt + 4 (custom)
Switch to test Alt + 5 (custom)
Switch to model Alt + 6 (custom)
Switch to view Alt + 7 (custom)
Switch to contraller Alt + 8 (custom)
Save Alt + S (custom)
Close Alt + W (custom)
Undo Alt + E (custom)
Redo Alt + R (custom)
Line Up Alt + I (custom)
Line Down Alt + K (custom)
Previous Column Alt + J (custom)
Next Column Alt + L (custom)
Line Start Alt + H (custom)
Line End Alt + ; (custom)
Page UP Alt + U (custom)
Page Down Alt + N (custom)
Previous Word Alt + O (custom)
Next Word Alt + P (custom)
Text Start Alt + 9 (custom) or Alt + B I (custom)
Text End Alt + 0 (custom) or Alt + B K (custom)
Duplicate Lines Alt + T (custom)
Cut Lines Alt + Y (custom)
Delete Lines Alt + D (custom)
Move Line Up Alt + ↑ (custom)
Move Line Down Alt + ↓ (custom)
Select Line Start Alt + [ (custom) or Alt + B J (custom) or Ctrl + H (custom)
Select Line End Alt + ] (custom) or Alt + B L (custom) or Ctrl + ; (custom)
Select Previous Column Alt + < (custom) or Ctrl + J (custom) Select Next Column Alt + > (custom) or Ctrl + L (custom)
Select Line Up Ctrl + I (custom)
Select Line Down Ctrl + K (custom)
Select Next Word Alt + G (custom)
Scroll Line Up Ctrl + ↑
Scroll Line Down Ctrl + ↓
Toggle Comment Alt + M (custom)
Collapse Alt + Q (custom)
Expand Alt + A (custom)
Go To Line Alt + B G (custom) or Ctrl + G (custom)
Cut Alt + X (custom) or Ctrl + X
Copy Alt + C (custom) or Ctrl + C
Paste Alt + V (custom) or Ctrl + V

Show View Alt + B N (custom)
Activate Editor Alt + B M (custom) or F12

=> j(Alt + F)

贴这篇文章的时候还有个小插曲,上下方向键(即↑和↓)不知道怎么用HTML表示,后来用ruby写了段script,生成了HTML的特殊字符(其实应该是UTF-8编码),找啊找,终于找到了:
&#8593;  =>  ↑
&#8595; => ↓

script写得很简单:
for i in (m..n) do
puts "<span>&\##{i};</span>"
end
保存为tm.rb,将m和n换成你要查找的范围,如32..2000或8000..10000,然后在命令行里运行:

ruby tm.rb > temp.html


再用浏览器打开temp.html,你就会看到很多神奇的符号了。哈哈。

没有评论: