# Sublime 設定筆記
[toc]
## 在 sublime 快捷
shift +tab 往前縮排
### Setting User
```python=
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme",
"font_face": "Ariel",
"font_size": 16,
"tab_size":2,
"translate_tabs_to_spaces":true,
"draw_white_space":"all",
"ignored_packages":
[
"Vintage"
],
"shell": "true"
}
```
---
## 在 sublime 查看 python 板本
```import sys```
```print(sys.version)```
[Setting Your Python Version in Sublime-Text :green_book: ](https://medium.com/swlh/setting-your-python-version-in-sublime-text-8e8a305e6701)
## 在 sublime + git
1. open sublime “shift+command+p” show 「command palette」
2. type : "Package Control: Install Package"
3. type : 'git'
4. install ....different git package
## Sublime text 3 安裝conda
方便得切换conda设置的不同虚拟环境
shift+command+p -> conda
https://www.zhihu.com/question/20539058
## Sublime text 3 使用matplotlib進行繪圖時,圖形不顯示解決辦法
https://www.itread01.com/p/871045.html
在使用Sublime text 3進行編譯python檔案時,會遇到使用matplotlib繪圖但是圖形顯示不出來的問題。雖然Sublime 左下角顯示程式碼在Building,但是沒有結果出來。原因是Sublime 預設情況下是不用shell的,但是matplotlib又是需要的,因此解決的辦法是,在python3.sublime-build 檔案中新增如下程式碼:
"shell": "true"
測試 sample :
```python=
import numpy as np
import matplotlib.pyplot as plt
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()
```

---
## Editor User Setting
[sublime 自訂設定教學](https://www.itread01.com/p/871045.html)
Preferences –>>Settings(Settings User)
**User setting** eg :
```
{
"font_face": "DisposableDroid BB",
"font_size": 20,
"shell": "true",
"ignored_packages":
[
"Vintage"
]
}
```
---
## Build System Setting
- User 設定檔儲存位置
/Users/peggie/Library/Application Support/Sublime Text 3/Packages/User/Pyenv.sublime-build
- 設定檔內容
在想執行的虛擬環境找路徑 eg. /Users/peggie/Qt369/bin/python3
```bash=
{
"cmd": ["/Users/peggie/Qt369/bin/python3","-u", "$file"],
"file_regex": "^[ ]*file \", line ([0-9]*)",
"selector": "source.python"
}
#只要更換 "/Users/peggie/Qt369/bin/python3" 此路徑並存檔
```
> [name=Chieh Fang]