code-prettify

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

2016年5月13日 星期五

關閉 Sublime Text 3 記憶已開啟的檔案

因為想把 Sublime Text 當作預設文字編輯器,
但是有兩個習慣一直無法適應,所以決定把他的設定改掉。

第一,當 Sublime Text 關閉時,當檔案有修改時,並不會詢問是否要存檔,
而是幫你保留當下的變更,當下次你啟動時再給你看,這是 hot_exit 功能。

第二,當 Sublime Text 開啟時,會記憶你上次開啟的檔案,一次開給你看,
這個叫 remember_open_files 功能。

幸好 Sublime Text 擁有高客制化的能力,
透過 Preferences / Settings-User 叫出個人化設定檔,
加上這兩行即可

"hot_exit": false,
"remember_open_files": false,

實際設定圖片:



資料來源:
How To Disable Remember Open Files in Sublime Text 3
http://www.unixmen.com/disable-remember-open-files-sublime-text-3/

2015年8月4日 星期二

如何讓 Sublime Text 3 顯示目前編碼

上次提過將 Sublime Text 加入右鍵選單,
這次遇到如何顯示檔案編碼 (encoding) 的問題,
其實也是從 notepad++ 轉用 Sublime Text 的習慣。

預設的 Sublime Text 3 的介面是這樣

首先選擇 Preferences / Settings - User

接著會出現使用者自訂設定檔

接著在大括號中輸入下列字串後存檔
"show_encoding": true,
成功!,右下角馬上就出現目前的編碼是 UTF-8 了!

2015年6月17日 星期三

如何將 Sublime Text 3 加入右鍵選單中

從 Notepad++ 改用 Sublime Text 之後,最不習慣的地方就是在右鍵選單內,
將下列內容存成 run.bat 後,以管理員的權限執行,就會將 Sublime Text 加入右鍵選單

 @echo off
  SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe

  rem add it for all file types
  @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"         /t REG_SZ /v "" /d "Open with Sublime Text 3"   /f
  @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
  @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% "%%1"" /f

  rem add it for folders
  @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"         /t REG_SZ /v "" /d "Open with Sublime Text 3"   /f
  @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
  @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% "%%1"" /f
  pause

資料來源
Add “Open with Sublime Text 3″ to Windows Explorer Context Menu
http://wordpress-corner.com/add-open-sublime-text-3-windows-explorer-context-menu/