Atom
Sublime text
I'm using present setting:
Preferences.sublime-setting-User{ "color_scheme": "Packages/Color Scheme - Default/Espresso Libre.tmTheme", "font_options": [ "gray_antialias" ], "font_size": 14, "ignored_packages": [ "Vintage" ], "material_theme_accent_indigo": true, "material_theme_big_fileicons": true, "material_theme_bold_tab": true, "material_theme_bright_scrollbars": true, "material_theme_compact_sidebar": true, "material_theme_tabs_autowidth": true, "tab_size": 2, "theme": "Material-Theme.sublime-theme", "translate_tabs_to_spaces": true, "trim_trailing_white_space_on_save": true, "bold_folder_labels": true, "overlay_scroll_bars": "enabled", "line_padding_top": 3, "line_padding_bottom": 3, } 編輯
⌘L
:全選所在行,連續按則往下繼續選下一行⌘D
:全選所在單字,連續按則往下繼續選相同單字,可以一次同時編輯所有選擇的單字⌃⇧M
:選擇花刮號({}:Curly brackets or braces)裡所有內容⌃M
:跳至相配對的花刮號⌃⇧K
:刪除所在行,連續按則往下繼續刪下一行⌘Z
+ ⌘y
:復原
⌘⇧Z :反復原
⌘⌥ + 滑鼠選擇 :可以垂直選擇
尋找/取代
⌘F
:尋找/取代:find all > 修改⌘⇧F
:在整個 Project 尋找/取代 # add "open folders" in the "where:" columns
- 安裝外掛
1.安裝 Package Control
https://packagecontrol.io/installation#st3
2.Package 外掛 搜尋:Package control
3.按⌘+shift+p
(叫出Package Control),接著輸入install
4.查詢已安裝的外掛:按⌘+shift+p
,接著輸入list
5.移除外掛:remove
BeautifyRuby 優化 Ruby 排版:ctrl + cmd + k
Themr 視覺主題管理:cmd + shift + p
-> 輸入 themr
Advanced New File 快速建立新檔案: cmd + option + n
, 輸入檔名前加上:
,即可在當前目錄下新增檔案。
PackageResourceViewer 開啟各個已安裝之 package 資料夾的 message 讀取安裝說明: Open Resource:
- 參考資料:
Sublime Text 3 新手上路:必要的安裝、設定與基本使用教學
進階使用
在 terminal 使用 Sublime 開啟特定目錄
我們在使用 terminal 時常常會瀏覽到不同的目錄的檔案,但當我們需要編輯該檔案時,則常常會使用 terminal 常用的編輯器(e.g. Vim),而我們可以讓 terminal 可以用 Sublime 開啟我們想要編輯的「檔案」或「目錄」。
設定 Sublime
將安裝的 Sublime 做一個軟連結連結到預設可執行的/usr/local/bin/
目錄中,並使用subl
當作執行的關鍵字
這裏我 Sublime 安裝的目錄是安裝在
應用程式 (/Application)
中,你必須依照你安裝的路徑去修改以下指令
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
在做好軟連結之後就可以使用subl
指令開啟想要編輯的「檔案」或「目錄」。
開啟/etc/hosts
檔案
$ subl /etc/hosts
開啟/etc/
目錄
開啟任何目錄時,只需要到該目錄下使用
subl .
就可以將整個目錄用 Sublime 開啟
$ cd /etc
etc $ subl .
VIM
Hit the Esc key; vim goes into command mode. Then you can type
:q
to quit (short for :quit
):q!
to quit without saving (short for :quit!
):wq
to write and quit (think write and quit):wq!
to write and quit even if file has only read permission (if file does not have write permission: force write):x
to write and quit (similar to :wq, but won't write if there are no changes):qa
to quit all (short for :quitall
)
When you press :
, a :
will appear at the bottom of the screen.
Or you can press Esc
ZZ
(Esc
Shift
+Z
Shift
+Z
) to write/save if the file was changed, then quit.
Or if you don't want to save changes you can use ZQ instead.
Vim has extensive help, so type Esc
:help
Return
and you will have all your answers and even a neat tutorial.