人生襍多

파이참 단축키 모음 - PyCharm 단축키 본문

카테고리 없음

파이참 단축키 모음 - PyCharm 단축키

이혁진 2021. 3. 26. 18:54

 

여러 단축키 중에 제가 자주 사용하는 것은 blod 표기 하였습니다.~ 

 


Action

Shift + Ctrl + A : Search for Action (IDE의 기능 검색 : Shift double type 시 전체 기능 검색으로 자동 이동)

- action에서 " Locate Duplicate" 입력 하면 중복코드 검색 가능

Code assistance

Ctrl + Alt + L : Code format ( 코드 자동 정렬 )

Ctrl + Alt + Shift + L : Whole file Code format

Ctrl + Alt + O : Import 정리

Ctrl + P : 인자값 즉시 보기

Ctrl + Q : Quick popups ( doc 주석 바로 보기 )

Ctrl + Shift + I : 코드 구현부 즉시 보기

F2 : next highlighted error

= Alt + Enter : 수정 내용 추천

= Ctrl + F1으로 에러 내용 확인

Editing

Alt + Shift + Up/Down : 현재 라인 위아래 이동

Ctrl+ Shift + Up/Down : 현재 라인의 메소드, IF 등 블럭 단위로 위아래 이동

Alt + Enter : Context action (파이썬 추천 코드 형식으로 리팩토링 제안)

Ctrl + Space : Basic code completion (the name of any class,method or variable)

- dic 변수 선언하고 가져다 쓸때, dic_name[ __ ] 상태에서 Ctrl + Space 누르면 Key 값 추천 됨 (caret은 _ 부근에 )

- Class 멤버 번수 init에 넣고 메소드에서 사용 할때 self. __ 에서 자동 완성 기능 됨

Ctrl + Shift + Space : Smart code completion (filters the list of methodsand variables by expected type)

Ctrl + Shift + Enter: Complete statement

Ctrl + P : 함수호출시 인수 정보 확인 (within method call arguments)

Ctrl + Q : 코드에 대한 문서창 팝업

Shift + F1 : 코드에 대한 문서 인터넷 브라우저로 팝업

Ctrl + mouse : 코드를 링크처럼 타고 들어감

Ctrl + F1 : Show descriptions of error or warning at caret

Alt + Insert : 코드 생성 (Getters, Setters, Constructors,hashCode/equals, toString)

Ctrl + O : 메서드 오버라이드 구현

Ctrl + I : 인터페이스 메서드 구현

Ctrl + Alt + T : 다음으로 코드 감싸기… (if..else, try..catch, for,synchronized, etc.)

Ctrl + Shift + Delete : Unwrap try

Ctrl + / : 줄 단위 주석 토글

Ctrl + Shift + / : 블럭 단위 주석 토글

Ctrl + W : 가장 안쪽의 괄호부터 선택(점점 확장 된다.)

Ctrl + Shift + W : Decrease current selection to previous state

Alt + Q : Context info

Alt + Enter : Show intention actions and quick-fixes

Ctrl + Alt + L : 파일 단위 재정렬 (이클립스의 ctrl + shift + f)

Ctrl + Alt + O : import 문 최적화

Ctrl + Alt + I : 줄단위 재정렬

Tab / Shift + Tab : 들여쓰기/내어쓰기

Ctrl + X or Shift + Delete : 잘라내기 (블럭 선택이 안되어 있으면 라인을 잘라냄)

Ctrl + C or Ctrl + Insert : 복사하기(블럭 선택이 안되어 있으면 라인을 복사함)

Ctrl + V or Shift + Insert : 붙여넣기

Ctrl + Shift + V : 복사하기 (목록에서 선택하여)

Ctrl + D : 선택된 블럭을 복제

Ctrl + Y : 캐럿을 있는 곳의 라인 삭제

Ctrl + Shift + J : 스마트하게 코드를 한 줄로 합친다.

Ctrl + Enter : 스마트하게 코드를 여러줄로 나눈다.

Shift + Enter : 커서가 어디에 있건 다음 라인을 생성하고 첫줄로 이동

Ctrl + Shift + U : 커서가 있는 곳이나 블럭이 있는 곳을 대문자 및 소문자로 치화

Ctrl + Shift + ] / [ : 가장 가까운 괄호 시작/종료로 이동

Ctrl + Delete : 단어 삭제 (커서 시작부터)

Ctrl + Backspace : Delete to word start

Ctrl + '+/-' : Expand/collapse code block

Ctrl + Shift + '+/-' : Expand/collapse ALL code block

Ctrl + F4 : Close active editor tab

 

Alt + J : Multiple select ( HTML 태크 속성 같은 것을 선택 </td> )

Alt + Shift + J : 위에 역

Postfix completion

if movies_dict.get('year') is not None: ### movies_dict.get('year').ifnn

my_car = Car() print("The car has driven ${my ____ kilometers")

Navigation

Ctrl + B or Ctrl + Click : Go to declaration

Alt + F7 / Ctrl + F7 : Find usages , Find usages in file

Ctrl + F12 : 파이선 파일의 클라스 구조 요약해서 보여 주고 검색 가능하여, 해당 코드로 바로 이동 가능

Alt + 7 : 파이선 파일의 클라스 구조 보여 줌

Ctrl + E : Recent files popup

Ctrl + Shift + E : 최근 방문한 코드 파일 popup

Shift press twice : Search Everywhere

Ctrl + N : Go to class

Ctrl + Shift + N : Go to file

Ctrl + Alt + Shift + N : Go to symbol

Alt + Right/Left : Go to next/previous editor tab

F12 : Go back to previous tool window

Esc : Go to editor (from tool window)

Shift + Esc : Hide active or last active window

Ctrl + Shift + F4 : Close active run/messages/find/... tab

Ctrl + G : Go to line

Ctrl + Alt + Left/Right : Navigate back/forward

Ctrl + Shift + Backspace : Navigate to last edit location

Alt + F1 : Select current file or symbol in any view

Ctrl + Alt + B : Go to implementation(s)

Ctrl + Shift + I : Open quick definition lookup

Ctrl + Shift + B : Go to type declaration

Ctrl + U : Go to super-method/super-class

Alt + Up/Down : Go to previous/next method

Ctrl + ] / [ : Move to code block end/start

Ctrl + F12 File : structure popup

Ctrl + H Type : hierarchy

Ctrl + Shift + H : Method hierarchy

Ctrl + Alt + H : Call hierarchy

F2 / Shift + F2 : Next/previous highlighted error

F4 / Ctrl + Enter : Edit source / View source

Alt + Home : Show navigation bar

F11 : Toggle bookmark

Ctrl + F11 : Toggle bookmark with mnemonic

Ctrl + #[0-9] : Go to numbered bookmark

Shift + F11 : Show bookmarks

Refactoring

Shift + F6 : Rename

- Alt + 3 : 창이 뜨면 refactoring 대상 삭제 가능

Ctrl + Alt + V: Extract variable

- 반복 변수 (arr[i+1] 에서 'i+1' 도 해당) 추출 하여, 가독성 높일수 있음

Ctrl + Alt + M : Extract Method

- a[i], a[i + 1] = a[i + 1], a[i] 의 구문이 반복적으로 사용시, 자동으로 추출 및 메소드 생성 가능

F5 : Copy

F6 : Move

Alt + Delete : Safe Delete

Ctrl + F6 : Change Signature

Ctrl + Alt + N : Inline

Ctrl + Alt + F : Extract Field

Ctrl + Alt + C: Extract Constant

Ctrl + Alt + P : Extract Parameter

Debugging

Shift + F9 : 디버깅 시작

Ctrl + F8 : Toggle breakpoint

Ctrl + Alt + F8 : 디버깅 중 인자값 예상 가능

def extract_number(s): return int(s.split()[0]) # s.split()[0] 값 예상 가능 / s.split()[0] 셀렉해줘야 나옴

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 + Shift + F8 : View breakpoints


Double Shift Search everywhere

Ctrl + F : Find

F3 : Find next

Shift + F3 : Find previous

Ctrl + R : Replace

Ctrl + Shift + F : Find in path

Ctrl + Shift + R : Replace in path

Ctrl + Shift + S : Search structurally (Ultimate Edition only)

Ctrl + Shift + M : Replace structurally (Ultimate Edition only)

Usage Search

Alt + F7 / Ctrl + F7 : Find usages , Find usages in file

Ctrl + Shift + F7 : Highlight usages in file

Ctrl + Alt + F7 : Show usages

Compile and Run

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

 

 

VCS/Local History

Ctrl + K : Commit project to VCS

Ctrl + T : Update project from VCS

Alt + Shift + C : View recent changes

Alt + BackQuote (`) : ‘VCS’ quick popup

Live Templates

Ctrl + Alt + J : Surround with Live Template

Ctrl + J : Insert Live Template

iter : Iteration according to Java SDK 1.5 style

inst : Check object type with instanceof and downcast it

itco : Iterate elements of java.util.Collection

itit : Iterate elements of java.util.Iterator

itli : Iterate elements of java.util.List

psf : public static final

thr : throw new

General

Alt + #[0-9] : Open corresponding tool window

Ctrl + S : Save all

Ctrl + Alt + Y : Synchronize

Ctrl + Shift + F12 : Toggle maximizing editor

Alt + Shift + F : Add to Favorites

Alt + Shift + I : Inspect current file with curre?nt profile

Ctrl + BackQuote (`) : Quick switch current scheme

Ctrl + Alt + S : Open Settings dialog

Ctrl + Alt + Shift + S : Open Project Structure dialog

Ctrl + Shift + A : Find Action

Ctrl + Tab : Switch between tabs and tool window

메인메소드 생성 및 실행

- 디렉토리, 패키지, 클래스 등 생성 목록 보기

맥 : Command + n

윈도우 : Alt + Insert

- 코드 템플릿

메인 메소드 : psm

System.out.println() : sout

if Null 구문 : ifn

실행환경 실행

- 현재포커스

맥 : Command + Shift + R

윈도우, 리눅스 : Shift + Ctrl + F10

- 이전실행

맥 : Ctrl + R

윈도우 : Shift + F10

라인 수정하기

-라인 합치기(라인단위)

맥 : Command + Shift + J

윈도우 : Ctrl + Shift + J

라인 단위로 옮기기

- 구문 이동

맥 : Command + Shift + 위,아래

윈도우 : Ctrl + Shift + 위,아래

- 라인 이동

맥 : Option + Shift + 위,아래

윈도우 : Alt + Shift + 위,아래

- Element 단위로 옮기기

맥 : Option + Shift + Command+ 왼쪽,오른쪽

윈도우 : Alt + Ctrl + Shift + 왼쪽,오른쪽

포커스 에디터

- 단어별 이동

맥 : Alt + <, >

윈도우, 리눅스 : Ctrl + <, >

- 단어별 선택

맥 : Shift + Alt + <, >

윈도우, 리눅스 : Shift + Ctrl + <, >

- 라인 첫/끝 이동

맥 : Fn + <, >

윈도우 : Home, End

- 라인 전체 선택

맥 : Shift + Command + <, >

윈도우, 리눅스 : Shift + Home, End

- Page Up/Down

맥 : Fn + 위/아래

윈도우 : Page Up / Down

포커스 특수키

- 포커스 뒤로/앞으로 가기

맥 : Command + [ , ]

윈도우, 리눅스 : Ctrl + Alt + 좌,우

- 멀티 포커스

맥 : Alt + Alt + 아래

윈도우, 리눅스 : Ctrl + Ctrl + 아래

- 오류 라인 자동 포커스

맥 : F2

윈도우, 리눅스 : F2

검색 텍스트

- 현재 파일에서 검색

맥 : Command + F

윈도우 : Ctrl + F

- 현재 파일에서 교체

맥 : Command + R

윈도우 : Ctrl + R

- 전체 검색

맥 : Command + Shift + F

윈도우 : Ctrl + Shift + F

- 정규표현식으로 검색, 교체

맥, 윈도우 : Regex 체크

검색기타

- 파일 검색

맥 : Shift + Command + O

윈도우 : Shift + Ctrl + N

- 메소드 검색

맥 : Alt + Command + O

윈도우 : Shift + Ctrl + Alt + N

- Action 검색

맥 : Shift + Command + A

윈도우 : Shift + Ctrl + A

- 최근 열었던 파일 목록 보기

맥 : Command + E

윈도우 : Ctrl + E

- 최근 수정했던 파일 목록 보기

맥 : Command + Shift+ E

윈도우 : Ctrl + Shift + E

- 변수/필드의 데이터 변경 지점 찾기

변경되는 포인트 : 변수나 필드에 커서를 놓고 action 에서 "dataflow" 입력 후 "Analyze Dataflow to Here" 선택

영향주는 포인트 : 변수나 필드에 커서를 놓고 action 에서 "dataflow" 입력 후 "Analyze Dataflow from Here" 선택

- 중복된 코드 찾기

action에서 " Locate Duplicate" 입력

자동완성

- 스태틱 메소드 자동완성

맥 : control + Shift * 2

윈도우 : control + Shift * 2

- Getter/Setter/생성자 자동완성

맥 : Command + N

윈도우 : Alt + Insert

- 자동완성

맥 : control + I

윈도우 : Ctrl + I

Live Template

- Live Template 목록 보기

맥 : Command + J

윈도우, 리눅스 : Ctrl + J

- Live Template 메뉴에서 나만의 템플릿 추가 가능

리팩토링 Extract

- 변수 추출하기

맥 : Command + Option + V

윈도우, 리눅스 : Ctrl + Alt + V

- 파라미터 추출하기

맥 : Command + Option + P

윈도우, 리눅스 : Ctrl + Alt + P

- 메소드 추출하기

맥 : Command + Option + M

윈도우, 리눅스 : Ctrl + Alt + M

- 이너클래스 추출하기

맥 : F6

윈도우, 리눅스 : F6

리팩토링 기타

- 이름 일괄 변경 하기

맥 : Shift + F6

윈도우, 리눅스 : Shift + F6

- 메소드 일괄 변경하기

맥 : Shift + Command + F6

윈도우, 리눅스 : Shift + Ctrl + F6

- Import 정리하기

맥 : control + Option + O

윈도우, 리눅스 : Ctrl + Alt + O

- Import 자동 정리하기

Settings | Editor | General | Auto Import에서 Optimize imports on the fly 선택

- 코드 자동 정렬하기

맥 : Command + Option + L

윈도우, 리눅스 : Ctrl + Alt + L

디버깅

- Debug 모드로 실행하기(현재 위치의 메소드)

맥 : control + Shift + D

윈도우, 리눅스 : 없음

- Debug 모드로 실행하기(이전에 실행한 메소드)

맥 : control + D

윈도우, 리눅스 : Shift + F9

- Resume(다음 브레이크 포인트로 이동하기)

맥 : Command + Option + R

윈도우, 리눅스 : F9

- Step Over(현재 브레이크에서 다음 한줄로 이동하기)

맥 : F8

윈도우, 리눅스 : F8

- Step Into(현재 브레이크의 다음 메소드로 이동)

맥 : F7

윈도우, 리눅스 : F7

- Step Out(현재 메소드의 밖으로 이동)

맥 : Shift + F8

윈도우, 리눅스 : Shift + F8

- Evaluate Expression(브레이크된 상태에서 코드 사용하기)

맥 : Option+ F8

윈도우, 리눅스 : Alt + F8

- Watch(브레이크 이후의 코드 변경 확인하기)

맥 : 없음

윈도우, 리눅스 : 없음

Git 기본 기능 사용하기

- Git View On

맥 : Command + 9

윈도우, 리눅스 : Alt + 9

- Git Option Popup

맥 : control + V

윈도우, 리눅스 : Alt + '(Tab 위 버튼)

- Git History

맥 : control + V --> 4

윈도우, 리눅스 : Alt + '(Tab 위 버튼) --> 4

- Branch

맥 : control + V --> 7

윈도우, 리눅스 : Alt + '(Tab 위 버튼) --> 7

- Commit

맥 : Command + k

윈도우, 리눅스 : Ctrl + k

- Push

맥 : Command + Shift + k

윈도우, 리눅스 : Ctrl + Shift + k

- Pull

맥 : Command + Shift + A --> git pull

윈도우, 리눅스 : Ctrl + Shift + A --> git pull

GitHub 연동하기

- GitHub 연동하기

맥 : Command + Shift + A --> Share github

윈도우, 리눅스 : Command + Shift + A --> Share github

- GitHub Clone

메인 화면에서 Check out from Version Control 선택 후 Git 선택

클래스

- 클래스 구조 확인

맥 : command+7

윈 : Alt + 7

플러그인

- 플러그인 설치

맥 : Command + Shift + A --> Plugins(Preferences)

윈도우, 리눅스 : Command + Shift + A --> Plugins(Preferences)

- Terminal

맥 : Option+ F12

윈도우, 리눅스 : Alt + F12

추천 플러그인

- .ignore

https://plugins.jetbrains.com/plugin/7495--ignore

- Presentation Assistant : 단축키 노출(윈도우, 맥)

https://plugins.jetbrains.com/plugin/7345-presentation-assistant

- BashSupport : .sh 확장자를 가진 Bash Script 작성 기능을 제공

https://plugins.jetbrains.com/plugin/4230-bashsupport

- Material Theme UI

https://plugins.jetbrains.com/plugin/8006-material-theme-ui

- Free MyBatis plugin : 마이바티스 플러그인

https://plugins.jetbrains.com/plugin/8321-free-mybatis-plugin

- CodeGlance : 코드 미니맵을 에티터창에 표시

https://plugins.jetbrains.com/plugin/7275-codeglance

- Rainbow Brackets : 각종 괄호를 짝에 맞게 무지개색으로 표시

https://plugins.jetbrains.com/plugin/10080-rainbow-brackets

- JetBrain 서버에 Intellij 셋팅을 연동

https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html

[출처 참조 : https://lalwr.blogspot.com/2018/04/intellij.html

Comments