Intellij idea快捷鍵與設(shè)置(Mac)
1. 代碼提示大小寫不敏感
Preferences -- Editor -- General -- Code Completion -- 取消勾選"Math case"
**2. 清除過往項(xiàng)目緩存** 當(dāng)創(chuàng)建項(xiàng)目時(shí),如果存在以往創(chuàng)建過的同名項(xiàng)目,將會(huì)提示下面的錯(cuò)誤: `Failed to create a Maven project: ‘xxx/pom.xml‘ already exists in VFS` 解決此問題的步驟是: File -- Invalidate Caches/Restart -- 執(zhí)行Invalidate and Restart
**3. 新增Spring context xml模板** 通過下面的步驟進(jìn)入設(shè)置界面 File -- Other Settings -- Preferences for New Projects -- Editor -- File and Code Templates 添加一個(gè)"Spring Context XML",后綴為"xml"的模板,內(nèi)容如下: ```xml
<!-- regular spring configuration file defining the beans for this
bundle. The configuration of OSGi definitions is kept in a separate
configuration file so that this file can easily be used
for integration testing outside of an OSGi environment -->
**4. Tab鍵跳出引號和括號** Intellij IDEA -- Preferences -- Editor -- General -- Smart Keys -- 勾選"Jump outside closing bracket/quote with Tab"
**5. 自動(dòng)清除多余的引用(import)** control + option + 字母O
**6. 修改代碼行距** Intellij IDEA -- Preferences -- Editor -- Font -- Line Spacing
**7. 取消單行代碼自動(dòng)折疊** Intellij IDEA -- Preferences -- Editor -- General -- Code Folding -- 取消勾選"One-line methods"
**8. 關(guān)閉拼寫檢查器** 當(dāng)拼寫檢查器發(fā)現(xiàn)疑似拼寫錯(cuò)誤時(shí),會(huì)用綠色下劃波浪線提示我們,要關(guān)閉此功能,執(zhí)行: Intellij IDEA -- Preferences -- Editor -- Inspections -- Spelling -- Typo,將選項(xiàng)卡下的幾個(gè)復(fù)選框取消勾選。
**9. 生成getter和setter** 在編輯區(qū)域鼠標(biāo)右鍵,選擇"generate..."--"Getter and Setter",從彈出窗口里選擇要生成Getter和Setter的屬性。 快捷鍵是command + N
**10. 整行移動(dòng)** option + shift + 上/下
**11. 選中光標(biāo)左右的行內(nèi)容** command + shift + 左/右
**12. (光標(biāo)所在)整行刪除** command + delete
**13. 強(qiáng)制類型轉(zhuǎn)換** option + Enter
**14. 復(fù)制(懸浮)提示框里的內(nèi)容** 選中提示框里的文本內(nèi)容,然后按住option + Q,再點(diǎn)左鍵
**15. 顯示/隱藏左右邊欄** 點(diǎn)擊最左下角的小圖標(biāo)
**16. 已知類名,生成import** 點(diǎn)擊類名,然后option + Enter
**17. 新起一行,并移動(dòng)光標(biāo)到行首** 向上:option + command + Enter 向下:shift + Enter
**18. 大小寫轉(zhuǎn)換** command + shift + u
**19. pom.xml智能提示失效的修復(fù)** 一般出現(xiàn)這種情況,需要進(jìn)入Maven--Repositories里,Update一下倉庫

浙公網(wǎng)安備 33010602011771號