顯示具有 Sublime Text 2 標籤的文章。 顯示所有文章
顯示具有 Sublime Text 2 標籤的文章。 顯示所有文章

2014/09/03

Sublime Text 2 預設快速鍵清單(批次生成)

想把 default的 keybinding轉成比較容易讀的字樣,用javascript跑。
Hash中的內容有些沒抓出來,往後再修,我猜Sublime應該也不會在更了

var keybinding = subelime原來的default keybinding

var html_content = ""

html_content +="<table style='margin: 5px; padding: 5px; '><tbody>";

for(var i =0; i <keybinding.length; i++){
if (i%10==0){
html_content+="<tr><th style='background-color: #b8b8b8; color: white; width: 25%;'>組合鍵</th><th style='background-color: #b8b8b8; color: white; width: 70%;'>功能</th></tr></br>";
} else {
html_content+="<tr>";
}

if(i%2==0){
html_content+="<td style='background-color: #f0f0f0;'>"+keybinding[i].keys+"</td>"+"<td style='background-color: #f0f0f0;'>"+keybinding[i].command+"</td><br>";
}else{
html_content+="<td id='double'>"+keybinding[i].keys+"</td>"+"<td id='double'>"+keybinding[i].command+"</td><br>";
}
html_content+="</tr><br>";
};
html_content+="</tbody></table>";
html_content = html_content.replace(/super/g, "⌘");
html_content = html_content.replace(/ctrl/g, "⌃");
html_content = html_content.replace(/alt/g, "⌥");
html_content = html_content.replace(/enter/g, "⏎");
html_content = html_content.replace(/shift/g, "⇧")
html_content = html_content.replace(/backspace/g, "⌫");
html_content = html_content.replace(/\+tab/g, "⇥");
html_content = html_content.replace(/tab\+/g, "⇥");
html_content = html_content.replace(/\+delete/g, "⌦");
html_content = html_content.replace(/delete\+/g, "⌦");
html_content = html_content.replace(/escape/g, "⎋");
html_content = html_content.replace(/\+/g, " + ");

組合鍵功能
⌘ + ⇧ + nnew_window
⌘ + ⇧ + wclose_window
⌘ + oprompt_open
⌘ + ⇧ + treopen_last_file
⌘ + ⌥ + upswitch_file
⌘ + nnew_file
⌘ + ssave
⌘ + ⇧ + sprompt_save_as
⌘ + ⌥ + ssave_all
⌘ + wclose
組合鍵功能
⌘ + k,⌘ + btoggle_side_bar
⌘ + ⌃ + ftoggle_full_screen
⌘ + ⌃ + ⇧ + ftoggle_distraction_free
⌘ + zundo
⌘ + ⇧ + zredo
⌘ + yredo_or_repeat
⌘ + usoft_undo
⌘ + ⇧ + usoft_redo
⌘ + xcut
⌘ + ccopy
組合鍵功能
⌘ + vpaste
⌘ + ⇧ + vpaste_and_indent
⌃ + ⌥ + leftmove
⌃ + ⌥ + rightmove
⌃ + ⌥ + ⇧ + leftmove
⌃ + ⌥ + ⇧ + rightmove
⌃ + leftmove
⌃ + rightmove
⌃ + ⇧ + leftmove
⌃ + ⇧ + rightmove
組合鍵功能
⌃ + ⌥ + upscroll_lines
⌃ + ⌥ + downscroll_lines
⌃ + ⇧ + upselect_lines
⌃ + ⇧ + downselect_lines
⌘ + ⇧ + [prev_view
⌘ + ⇧ + ]next_view
⌘ + ⌥ + leftprev_view
⌘ + ⌥ + rightnext_view
⌃⇥next_view_in_stack
⌃ + ⇧⇥prev_view_in_stack
組合鍵功能
⌘ + aselect_all
⌘ + ⇧ + lsplit_selection_into_lines
single_selection
clear_fields
clear_fields
hide_panel
hide_overlay
hide_auto_complete
⌘ + ]indent
⌘ + [unindent
組合鍵功能
tabinsert_best_completion
tabinsert_best_completion
tabreplace_completion_with_next_completion
tabreindent
tabindent
tabnext_field
tabcommit_completion
⇧⇥insert
⇧⇥unindent
⇧⇥unindent
組合鍵功能
⇧⇥unindent
⇧⇥prev_field
⌘ + lexpand_selection
⌘ + dfind_under_expand
⌘ + k,⌘ + dfind_under_expand_skip
⌘ + ⇧ + spaceexpand_selection
⌃ + ⇧ + mexpand_selection
⌃ + mmove_to
⌘ + ⇧ + jexpand_selection
⌘ + ⇧ + aexpand_selection
組合鍵功能
⌘ + ⌥ + .close_tag
⌃ + qtoggle_record_macro
⌃ + ⇧ + qrun_macro
⌘ + ⏎run_macro_file
⌘ + ⇧ + ⏎run_macro_file
commit_completion
⌘ + tshow_overlay
⌘ + pshow_overlay
⌘ + ⇧ + pshow_overlay
⌘ + ⌃ + pprompt_select_project
組合鍵功能
⌘ + rshow_overlay
⌃ + gshow_overlay
⌘ + ishow_panel
⌘ + ⇧ + ishow_panel
⌘ + fshow_panel
⌘ + ⌥ + fshow_panel
⌘ + ⌥ + ereplace_next
⌘ + gfind_next
⌘ + ⇧ + gfind_prev
⌘ + eslurp_find_string
組合鍵功能
⌘ + ⇧ + eslurp_replace_string
⌥ + ⌘ + gfind_under
⇧ + ⌥ + ⌘ + gfind_under_prev
⌃ + ⌘ + gfind_all_under
⌘ + ⇧ + fshow_panel
f4next_result
⇧ + f4prev_result
f6toggle_setting
⌃ + f6next_misspelling
⌃ + ⇧ + f6prev_misspelling
組合鍵功能
⌃ + ⌘ + upswap_line_up
⌃ + ⌘ + downswap_line_down
⌃ + ⌫delete_word
⌃⌦delete_word
⌘ + forward_slashtoggle_comment
⌘ + ⌥ + forward_slashtoggle_comment
⌘ + jjoin_lines
⌘ + ⇧ + dduplicate_line
⌃ + backquoteshow_panel
⌃ + spaceauto_complete
組合鍵功能
⌃ + spacereplace_completion_with_auto_complete
⌘ + ⌥ + pshow_scope_name
⌃ + ⇧ + pshow_scope_name
f7build
⌘ + bbuild
⌘ + ⇧ + bbuild
⌃ + ttranspose
f5sort_lines
⌃ + f5sort_lines
"insert_snippet
組合鍵功能
"insert_snippet
"move
run_macro_file
'insert_snippet
'insert_snippet
'move
run_macro_file
(insert_snippet
(insert_snippet
)move
組合鍵功能
run_macro_file
[insert_snippet
[insert_snippet
]move
run_macro_file
{insert_snippet
{insert_snippet
}move
run_macro_file
run_macro_file
組合鍵功能
⇧ + ⏎run_macro_file
⌘ + ⌥ + 1set_layout
⌘ + ⌥ + 2set_layout
⌘ + ⌥ + 3set_layout
⌘ + ⌥ + 4set_layout
⌘ + ⌥ + ⇧ + 2set_layout
⌘ + ⌥ + ⇧ + 3set_layout
⌘ + ⌥ + 5set_layout
⌃ + 1focus_group
⌃ + 2focus_group
組合鍵功能
⌃ + 3focus_group
⌃ + 4focus_group
⌃ + ⇧ + 1move_to_group
⌃ + ⇧ + 2move_to_group
⌃ + ⇧ + 3move_to_group
⌃ + ⇧ + 4move_to_group
⌃ + 0focus_side_bar
⌘ + 1select_by_index
⌘ + 2select_by_index
⌘ + 3select_by_index
組合鍵功能
⌘ + 4select_by_index
⌘ + 5select_by_index
⌘ + 6select_by_index
⌘ + 7select_by_index
⌘ + 8select_by_index
⌘ + 9select_by_index
⌘ + 0select_by_index
f2next_bookmark
⇧ + f2prev_bookmark
⌘ + f2toggle_bookmark
組合鍵功能
⌘ + ⇧ + f2clear_bookmarks
⌥ + f2select_all_bookmarks
⌘ + k,⌘ + uupper_case
⌘ + k,⌘ + llower_case
⌘ + k,⌘ + spaceset_mark
⌘ + k,⌘ + aselect_to_mark
⌘ + k,⌘ + wdelete_to_mark
⌘ + k,⌘ + xswap_with_mark
⌘ + k,⌘ + gclear_bookmarks
⌘ + plusincrease_font_size
組合鍵功能
⌘ + equalsincrease_font_size
⌘ + minusdecrease_font_size
⌃ + ⇧ + winsert_snippet
⌃ + ⇧ + krun_macro_file
⌘ + ⌥ + qwrap_lines
⌘ + ⌥ + [fold
⌘ + ⌥ + ]unfold
⌘ + k,⌘ + 1fold_by_level
⌘ + k,⌘ + 2fold_by_level
⌘ + k,⌘ + 3fold_by_level
組合鍵功能
⌘ + k,⌘ + 4fold_by_level
⌘ + k,⌘ + 5fold_by_level
⌘ + k,⌘ + 6fold_by_level
⌘ + k,⌘ + 7fold_by_level
⌘ + k,⌘ + 8fold_by_level
⌘ + k,⌘ + 9fold_by_level
⌘ + k,⌘ + 0unfold_all
⌘ + k,⌘ + junfold_all
⌘ + k,⌘ + tfold_tag_attributes
⌘ + ⌥ + otoggle_overwrite
組合鍵功能
⌥ + f2context_menu
⌘ + ⌥ + ctoggle_case_sensitive
⌘ + ⌥ + rtoggle_regex
⌘ + ⌥ + wtoggle_whole_word
⌘ + ⌥ + atoggle_preserve_case
find_next
⇧ + ⏎find_prev
⌥ + ⏎find_all
find_next
⇧ + ⏎find_prev
組合鍵功能
⌥ + ⏎find_all
⌃ + ⌥ + ⏎replace_all
hide_panel
⇧ + ⏎find_prev
⌥ + ⏎find_all
⌘ + ,open_file
⌘ + k,⌘ + yyank
⌘ + k,⌘ + krun_macro_file
⌘ + k,⌘ + ⌫run_macro_file
⌘ + k,⌘ + cshow_at_c⏎
組合鍵功能
⌃ + yyank
⌘ + ⌫run_macro_file
⌘⌦run_macro_file
⌃ + krun_macro_file
⌃ + lshow_at_c⏎
⌃ + oinsert_snippet
⌃ + ⌘ + dnoop
⌃ + ⌘ + ⇧ + dnoop

2014/08/26

sublime & rubymine 熱鍵對照

只有整理自己常弄錯或忘記的對照,並不是完整的清單對照表


功能 Sublime Text RubyMine
刪除行 ⌘ + X ⌘ + ⌫
選擇整行 ⌘ + L 熱鍵R
跳到括號起點或終點 ⌃ + M 熱鍵R
選擇括號中所有內容 ⌃ + ⇧ + M 熱鍵R
刪除字標後所有行中內容 ⌘ + K ⌘ + ⌫
刪除字標前所有行中內容 ⌘ + K + ⌫ 熱鍵R
縮行 ⌘ + ] Tab
取消縮行 ⌘ + [ ⌃ + Tab
Comment / 取消Comment ⌘ + / ⌘ + /
區塊 Comment ⌘ + ⌥ + / ⌘ + ⇧ + /
重複上一個鍵盤熱鍵指令 ⌘ + Y 熱鍵R
貼上並正確縮行 ⌘ + ⇧ + V 熱鍵R
選擇下一個自動完成選擇 ⌃ + Space 熱鍵R
選擇上一個 column ⌃ + ⇧ + Up 熱鍵R
選擇下一個 column ⌃ + ⇧ + Down 熱鍵R
快速以檔名開啟檔案 ⌘ + P ⌘ + ⇧ + O
跳到 symbol ⌘ + R ⌘ + ⌥ + O
呼叫 Command prompt ⌘ + ⇧ + P 熱鍵R
開啟最後關閉的標籤頁 ⌘ + ⇧ + t 熱鍵R
上一個標籤頁 ^ + Tab ^ + Left
下一個標籤頁 ⇧ + ^ + Tab ^ + Right
自動完成 熱鍵S ^ + Space
功能一 熱鍵S 熱鍵R
功能一 熱鍵S 熱鍵R
功能一 熱鍵S 熱鍵R
功能一 熱鍵S 熱鍵R
功能一 熱鍵S 熱鍵R
功能一 熱鍵S 熱鍵R
功能一 熱鍵S 熱鍵R
功能一 熱鍵S 熱鍵R

2014/08/16

Sublime Text 2 筆記

在 Terminal用 subl直接執行 Sublime Text 

sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl

在 Service中新增 Open Folder by Sublime Text
  1. Automator中新增 Service
  2. Actions選擇 Shell Script
  3. Script中輸入 /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl -n $@
  4. Service receives selected選擇 file or folders
  5. 另存service,完成
多重游標 - 選擇下一個:command + d
多重游標 - 自由指定:command + click
多重選擇 - 選擇全部:command + control + g
區塊選擇:按著option  拖拉選擇文字區塊
區塊選擇:shift + cmd + L

指令搜尋:Shift + cmd + p
檔案搜尋: cmd + p 
模糊搜尋:cmd + p 關鍵字前先放#
跳到n行:cmd + p關鍵字用 :n
Symbol list:cmd + p 關鍵字前放@  可用在找methods/class/selector...

切換開啟之檔案 cmd + t
切換開啟之tab:cmd + 1~9
切換開啟之tab:cmd + opt  + left/right 或 ctrl + tab
Reference path(for assets): cmd+shift+p, copy project path
合併lines  command+j 用來處理array
編輯*.sublime-project 來決定顯示/隱藏之檔案,並可在Project Tab切換 file_exclude_patterns&folder_exclude_patterns, path
set_layout跟keybinding來自定畫面分割

left single quote: opt + ]
right single quote: shift + opt + ]
left double quote: opt + [
right double quote: shift + opt + [

跳到下一個字: Opt + right
將下一個字一起加入選擇: Opt + shift + right
選擇滑鼠指標所在單字: cmd + d
選擇檔案中所有與選擇指標所在之單字符合之字詞:cmd + ctrl + g
選擇滑鼠指標所在整行: cmd + l
將選擇區塊的選擇標籤分行:cmd + shift + l
選擇tag中的內容(可重複擴展選擇範圍):cmd + shift + a
選擇縮行中內容(可重複擴展選擇範圍):cmd + shift + j

跳躍至對應括號 ctrl + m
選擇括號中的內容:ctrl + shift + m
加上引號:點選字詞後直接打單/雙引號
整行上下換位置:cmd + ctrl + up/down

加入書籤:cmd+f2
列出可用的自動完成:cmd + space 可列出例如css可用的attributes
跳到下一個自動完成:tab 然後用cmd + space跳回清單


可用到的 package
  • 先裝 Package Control
  • Prefixr CSS瀏覽器支援的prefix 
    • ctrl+cmd+x 自動添加prefix
  • Emmet 使用Emmet功能 
    • opt+ctrl+left/right 跳區塊
    • cmd+shift+./, 選標籤
    • cmd+shift+/ 區塊comment
    • user preference: "auto_id_class": true 可以在tag中用.加入class 用#加入ID
  • AdvancedNewFile 指令列快速建立檔案&資料夾
  • SideBarEnhancement 擴充檔案列的右鍵功能
  • Linter 檢查語法錯誤
  • Gist 用GitHub的Gist來管理snippets 
  • DocBlockr 快速在comment中說明參數&常數
  • Themr 快速切換theme 
  • ApplySyntax 顯示Rails 中的Ruby syntax
  • LineEndings 檢查錯誤 alert when line ending is "windows"
  • sidebar enhancement 由於package control不再支援,需要手動安裝 ctrl + ` 指令列依序輸入以下兩行 
    • import os; path=sublime.packages_path(); (os.makedirs(path) if not os.path.exists(path) else None); window.run_command('exec', {'cmd': ['git', 'clone', 'https://github.com/titoBouzout/SideBarEnhancements', 'SideBarEnhancements'], 'working_dir': path})
      
      import os; path=sublime.packages_path(); window.run_command('exec', {'cmd': ['git', 'checkout', '37429739a0452a2dc36343fb7875ba7fcbeb88a9'], 'working_dir': os.path.join(path, 'SideBarEnhancements')})
設定:

隱藏檔案/資料夾

"file_exclude_patterns": ["._*", ".DS_Store", "*.png", "*.jpg", "*.gif" ],
"folder_exclude_patterns":[".git",".sass-cache"]
for TrailingSpace
        “trim_trailing_white_space_on_save”: true