更好的使用IntelliJ IDEA

2021-09-23 21:17:05 字數 2554 閱讀 5685

一   快捷鍵的使用

1.文字編輯

刪除 ctr + y

複製 ctr + d

2.智慧型提示

提示 ctr + space

智慧型提示 ctr + shift + space

完成當前語句 ctr + shift + enter

建議提示為引數 ctr + alt + p

對**重新排列格式 ctrl + alt + l

組織匯入,對imports進行優化 ctrl + alt + o

3.位置定位

定位到下乙個或上乙個錯誤 f2 / shift + f2

定位檔案頭 ctr+g (定位到檔案行數)

定位檔案尾 ctr+g 

定位到**塊開始 ctr + [

定位到**塊結束 ctr + ]

回到最近的視窗 f12

回到之前的檔案 alt + left

回到之後的檔案 alt + right

定位到最後編輯位置 ctrl + shift + backspace

從tool window或其他window切換到檔案編輯 esc

關閉最近開啟的視窗 shift + esc

4.類、方法、檔案定位

查詢類 ctr + n

查詢檔案 ctrl + shift + n

符號定位 ctrl + alt + shift + n

檢視檔案結構 ctrl + f12

最近開啟的檔案 ctr + e

定位下乙個方法 alt + down

定位上乙個方法 alt + up

檢視方法引數資訊 ctr + p

檢視方法、類的doc ctr + q

5.類、方法的結構檢視、定位

跳到類或方法的宣告 ctr + b

定位到類的父類、介面 ctr + u

檢視類的繼承結構 ctr + h

檢視方法的繼承結構 ctr + shift + h

檢視類或方法被呼叫情況 ctr + alt +h 

原地參看類、方法的宣告 ctrl + shift + i

6.執行與除錯

ctrl + f9 make project (compile modifed and dependent)

ctrl + shift + f9 compile selected file, package or module

alt + shift + f10 select configuration and run

alt + shift + f9 select configuration and debug

shift + f10 run

shift + f9 debug

ctrl + shift + f10 run context configuration from editor

debugging

f8 step over

f7 step into

shift + f7 smart step into

shift + f8 step out

alt + f9 run to cursor

alt + f8 evaluate expression

f9 resume program

ctrl + f8 toggle breakpoint

ctrl + shift + f8 view breakpoints

二 idea和eclipse的區別

idea 中 「new project」對應的是eclipse的「workspace」,而「new module」才是建立乙個工程;

idea 不會自動編譯和載入class,eclipse是自動的,

idea可以通過mode eclipse外掛程式來實現自動載入和編輯class;

idea 編輯的檔案是自動儲存的,不能設定為手動儲存。

三 idea常用設定

1.改變編輯文字字型大小

file -> settings -> editor colors & fonts -> font -> size

2.用*標識編輯過的檔案

editor –> editor tabs

在idea中,你需要做以下設定, 這樣被修改的檔案會以*號標識出來,你可以及時儲存相關的檔案。"mark modifyied tabs with asterisk"

3.顯示行號

如果預設**提示和補全快捷鍵跟輸入法衝突,如何解決:settings->keymap

5.如何讓游標不隨意定位

settings->editor中去掉allow placement of caret after end of line。

Linux之更好的使用Bash

bash是乙個為gnu計畫編寫的unix shell,也是目前大多數linux發行版採用的shell。shell英文翻譯為 貝殼 顧名思義,shell是系統的使用者介面,提供了使用者與核心進行互動操作的一種介面。它接收使用者輸入的命令並把它送入核心去執行。實際上shell是乙個命令直譯器,它解釋由使...

使用游標會更好

使用游標會更好 左直拳有兩個表,乙個比較巨大,大約 1千萬條記錄 表 big 另乙個只有 5000 條 表 all 現在需要根據表 all 來更新表 big。update big set bf1 0 where bigid in select bigid from all where sf1 0 但...

使用游標會更好

使用游標會更好 左直拳 有兩個表,乙個比較巨大,大約1千萬條記錄 表big 另乙個只有5000條 表small 現在需要根據表small來更新表big。update big set bf1 0 where bigid in select bigid from small where sf1 0 但是...