[IDE] Jetbrain Goland 筆記
從 Terminal 中直接啟動 Goland
- 打開 Goland
- 點擊上方工具列中的 Tools -> Create Command-line Launcher
Launch IntelliJ IDEA or Goland from command line (Linux or MacOs)
存檔時自動執行 format tool
Running 'goimports' on save in GoLand @ StackOverflow
透過 Goland 中的 File Watchers 可以添加存檔時要執行的 format tool:
快捷鍵
功能 | 快捷鍵 |
---|---|
Search Everywhere | Shift + Shift |
執行程式(Run, Debugging Actions, Evaluate Expression | Alt + F8 |
Replace in Path(搜尋並取代) | Cmd + Shift + R |
Fold All | cmd + shift + - |
選取或移動程式碼 | Alt + Shift + 上下左右 |
擴展選取下上行的程式碼 | Alt + 上/下 |
註解程式碼 | cmd + / |
觸發 Auto Complete | ctrl + space |
找出該 element 可以使用的 function | (ctrl + space) * 2 |
重新命名變數/檔案(rename) | shift + F6 |
將方法中的值獨立成變數(Extract Variable) | cmd + alt + V |
將變數放入方法中(Inline) | cmd + alt + N |
將程式拆成函式(Extract Function / Method) | cmd + alt + M |
Code Formatting | cmd + alt + L |
go fmt | cmd + alt + shift + F |
到程式錯誤提示的位置 | F2 |
依據建議修正錯誤 | alt + enter |
執行程式 | ctrl + shift + R |
游標與文字
功能 | 快捷鍵 |
---|---|
選取相同文字 | ctrl + G |
產生多個游標 | 按住 alt 點擊滑鼠 |
減少縮排 | shift + Tab |