IntelliJ IDEA
IntelliJ IDEA는 JetBrains사에서 제작한 상용 자바 통합 개발 환경이다. 줄여서 IntelliJ 혹은 IDEA로도 불린다.
Categories
Install
## IntelliJ Ultimate
sudo snap install intellij-idea-ultimate --classic
## IntelliJ Community (무료/오픈소스)
sudo snap install intellij-idea-community --classic
## Rider (C# IDEA)
sudo snap install rider --classic
속도 개선을 위한 JVM 옵션 조정
GPU 지원
다음과 같은 옵션들이 있다. 나중에 더 정확히 확인해보자.
-
-Dawt.java2d.opengl=true
-
-Dsun.java2d.d3d=true
-
-Dsun.java2d.noddraw=false
-
-Dsun.java2d.opengl=true
Meta key support
You have to open IDEs property file (Help -> Edit Custom Property ...
) and type:
PyCharm
Creating Virtual Environment
- PyCharm 2016.1 Help: Creating Virtual Environment
- PyCharm 2016.1 Help: Adding Existing Virtual Environment
- Python: 파이썬 실행환경의 독립 virtualenv & PyCharm
- PyCharm과 pyenv를 사용한 Django 개발 환경 설정
Dockerization
Jupyter
PyCharm hint
- Converting comments
- For comment-based type hints, PyCharm suggests an intention action that allows you to convert comment-based type hint to a variable annotation. This intention has the name Convert to variable annotation, and works as follows:
- {|class="wikitable"
! Before || After |- |
|
|}
Disable inspection (Lint)
Stubs
pycharm에서 pyi파일을 만드는 방법에 대한 내용.
Python Debug Server (원격 디버깅; Remote Debugging)
자세한 내용은 pydevd-pycharm 항목 참조.
CLion
- CLion 2016.1 Help: Quick Start Guide
- JetBrains CLion C++ IDE First Impressions
- CLion 1.2: Be more powerful with Google Test support, CMake coding assistance and more
TIP
- 10 tips to be productive in CLion, a cross-platform C/C++ IDE
- Refactorings in CLion: be safe and quick
- Rename Refactorings
Tuning
Install
PhpStorm
WebStorm
- Vue I18n#WebStorm SFC i18n yaml error - WebStorm에서 Single-file component로, vue-i18n을 yaml로 사용할 경우 syntax error 로 판단한다.
Debugging Chrome
vue-cli로 서버 기동후, Edit Configurations... > JavaScript Debug
선택, 기동된 서버의 URL 입력, Front-end web 프로젝트의 ROOT 디렉토리 선택.
Disable inspection (Lint)
Keyboard shortcut
NAME | MaxOSX | Windows | Linux | BRIEF |
Related Symbol | Ctrl+Cmd+Up | Ctrl+Alt+Home | Header/Source Switching | |
Go to define | Cmd+B | Ctrl+B | - | |
Choose implementation | Cmd+Alt+B | |||
Show Documentation | Ctrl+J | |||
Quickly navigate | Cmd+F12 | 현재 편집중인 엘리먼트(Element)의 심볼 목록 네비게이션을 볼 수 있다. | ||
Quickly select | Alt+F1 | 현재 편집중인 엘리먼트(Element)의 Target(View)을 선택한다. (e.g. Finder에서 보기) | ||
Terminal Window | Alt+F12 | |||
File Path | Cmd+Alt+F12 | 현재 편집중인 엘리먼트(Element)의 전체 디렉토리 노드를 선택하여 파일 탐색기2를 연다. | ||
Show parameters | Cmd+P | List of valid parameters. | ||
Find Usages | Alt+F7 | Shift+Alt+7 | ||
Previous/Next Occurrence | Cmd+Alt+Up/Down | |||
Previous/Next Cursor | Cmd+Alt+Left/Right | 전/후 커서 위치로 이동. | ||
Code Generate | Cmd+N | Test, Constructors, Member's getter & setter 등의 코드를 생성한다. | ||
Toggle Bookmark | F3 | |||
Show Bookmark | Cmd+F3 | |||
Toggle Breakpoint | Cmd+F8 | |||
Build | Cmd+F9 | |||
Resume Program | Cmd+Alt+R | |||
Path Popup | Ctrl+Alt+Shift+2 | 포커스가 맞춰진 파일(또는 폴더)의 OS용 파일 브라우저 팝업 띄우기. | ||
View | ||||
Parameter Info | Ctrl+P | |||
Navigate | ||||
Search Everywhere | Double Shift | |||
Search Class | Cmd+O | |||
Search File | Shift+Cmd+O | |||
Search Symbol | Cmd+Alt+O | |||
Recent Files | Cmd+E | |||
Debugging | ||||
Step Over | F8 | |||
Step Into | F7 | |||
Step Out | Shift+F8 | |||
Stop | Cmd+F2 |
Linux(Ubuntu)에서 키맵을 MacOSX용으로 변경할 경우 META키가 정상적으로 작동하지 않는 현상이 있다. 이 현상은 Ubuntu#How to use META key항목을 참조하면 해결할 수 있다.
Linux Keybinding with IdeaVIM
IdeaVIM Settings:
-
Ctrl+C
(Copy): IDE -
Ctrl+S
(Save): IDE -
Ctrl+V
(Paste): VIM
Idea Keymap:
- Paste:
Ctrl+Shift+V
Useful custom keymap
리눅스에서 macOS의 탭 이동 단축키를 사용하고 싶다면 Settings > Keymap 으로 들어간 후:
- Main Menu > Window > Editor Tabs > Select Next Tab:
Alt+Shift+]
- Main Menu > Window > Editor Tabs > Select Previous Tab:
Alt+Shift+[
경고음 (Alert) 제거 방법
- Is there a way to turn off the alert bell? – Rider Support | JetBrains
- How to turn off the bell sound in Intellij - Super User
ideaVIM 문제인가? 잘 모르것지만
So in your ~/.ideavimrc
, you can use the following:
Settings
파라미터 이름 (힌트) 숨기기
코드 수정한 사람 (Code Author) 숨기기
심볼의 사용중(usages) 카운트 숨기기
PyCharm CE setup
- 자동완성을 위해
core
디렉토리는Sources Root
로 지정한다- 해당 디렉토리에 마우스 커서 올려놓고 마우스 우클릭.
-
Mark Directory as > Sources Root
메뉴 선택.
- 자동완성을 위해
core/recc
디렉토리는Namespace package
로 지정한다- 해당 디렉토리에 마우스 커서 올려놓고 마우스 우클릭.
-
Mark Directory as > Namespace package
메뉴 선택.
- 공백 문자를 출력한다.
-
Editor > General > Appearance
이동. -
Show whitespaces
의 모든 체크박스 선택. -
Show line numbers
체크박스 선택. -
Shoiw indent guides
체크박스 선택.
-
- 맞춤법 검사(Spell Checker)를 위한 사전 단어를 등록한다.
-
Dictionary
플러그인을 설치한다. -
Editor > Proofreading > Spelling
에서Custom dictionaries
항목에project.dic
파일을 추가한다.
-
- Python code formatter, black 을 사용한다. 이를 위한
Code Style
변경-
Settings > Editor > Code Style > Python
에서Tabs and Indents
탭의Continuation indent
를4
로 변경.
-
- 한 줄은 88 문자로 고정한다.
-
Editor > General > Appearance
에서Show hard wrap and visual guides (configured in Code Style options)
를 선택. -
Editor > Code Style > Python
에서Wrapping and Braces
탭의Hard wrap at
항목을88
로 수정.
-
- Python Interpreter 선택.
-
Project: recc > Python Interpreter
이동. - 자신의 파이썬 환경 선택. (Virtual environment 추천)
-
PyCharm Pro setup
- Code 의 중복성 체크 제거.
-
Settings > Editor > Duplicates
이동. -
Python
항목의 체크박스 해제.
-
- SQL 외래키(Foreign key) 사용시 참조 에러 Disable.
-
Settings > Editor > Inspections
이동. -
SQL > Unresolved reference
항목의 체크박스 해제.
-
HTML http warning
해당 코드가 있는 Tag 직전에 다음 주석을 추가하면 된다.
Directories under your control
IntelliJ_-_mark_directory.png
- Mark directory as Excluded: 프로젝트에서 예외처리한다.
- Mark directory as Library files: 라이브러리 디렉토리로 적용한다. 단, symbol/class/file 인덱스 생성을 막는다.
로컬의 특정 JAR 파일을 종속성에 추가
- Maven -> pom.xml#로컬의 특정 JAR 파일을 종속성에 추가
- Apache Ant -> build.xml#로컬의 특정 JAR 파일을 종속성에 추가
- Gradle -> build.gradle#로컬의 특정 JAR 파일을 종속성에 추가
eclipse 프로젝트의 에서 .classpath 파일에 다음의 항목이 있다.
이에 해당하는 동일한 기능을 intellij 에서 설정하는 방법:
- 프로젝트 구조 열기
- IntelliJ 메뉴의 "File > Project Structure..." 를 선택 또는 단축키
Ctrl+Alt+Shift+S
를 사용해 프로젝트 구조 창을 엽니다.
- IntelliJ 메뉴의 "File > Project Structure..." 를 선택 또는 단축키
- 좌측 메뉴에서 "Modules"를 선택하고, 모듈 이름을 선택한 후 "Dependencies" 탭으로 이동합니다.
- 오른쪽의 "+" 버튼을 클릭한 다음, "JARs or Directories..."를 선택합니다.
- Eclipse에서 사용된 JAR 파일 (e.g.
lib/mseo-common_1.0.0.jar
)의 경로로 이동하여 해당 파일을 선택합니다. - IntelliJ에서 이 JAR 파일이 프로젝트의 라이브러리로 추가됩니다.
- "Apply"와 "OK"를 눌러 설정을 저장합니다.
IntelliJ_-_Add_JAR.png
Plugins
- Key Promoter X
- IDE 내에서 모든 버튼에 마우스 클릭 시 마우스 대신 사용할 수 있는 키보드 단축키 표시
- 단축키가 없는 버튼의 경우, 플러그인이 단축키를 할당할 것을 제안
- 마우스에 대한 의존도를 줄이고 빠르게 코딩할 수 있도록 도움
- Codota
- AI 기반 코드 완성 제안
- 코드 완성 제안을 더욱 관련성 있게 만들어 코딩 속도를 더욱 높여줌
- PyCharm에는 AiXCoder가 있고, 파이썬/자바스크립트/타입스크립트 등 다양한 언어 지원
- Randomness
- 개발하며 임의의 데이터를 입력할 일이 있을 때 유용하게 쓸 수 있는 플러그인
- 단축키로 난수, 문자열 및 UUID 등을 삽입해줌
- 테스트 코드 작성 등 상황에 맞춰 유용하게 쓸 수 있을 것
- Presentation Assistant
- 행사에서 IDE 기반 발표를 하거나 페어 프로그래밍을 할 때 유용하게 쓸 수 있는 플러그인
- 사용 중인 단축키 표시를 표시하여 청중이 발표자의 액션을 쉽게 따라갈 수 있게 해줌
Documentation
- CLion, Reference Card For Mac (Keymap)
-
CLion-ReferenceCardForMac-Keymap.pdf
Troubleshooting
I just see a grey window, nothing happens in xmonad
When I start intelliJ idea in Xmonad, I just see a grey window, nothing happens. Did anybody have success with this combination.
Yep, xmonad and Java swing application's don't play well with the default config. You'll need to set your WM name to "LG3D" for Java Swing apps to work. The easiest way to add a call to setWMName "LG3D" in your startupHook like this:
IDEA-78860
- IDEA-78860 Keyboard input sometimes is blocked when IBus is active
- Stackoverflow: Android Studio - IBus prior to 1.5.11 may cause input problems. See IDEA-78860 for details
아래와 같은 문제가 발생될 수 있다.
아래와 같이 ~/.profile
에 추가하면 된다.
경고 |
다만, 이와 같이 수정하였을 경우 한글 입력이 정상적으로 작동하지 않을 수 있다. |
IntelliJ global environment variable
- fix PATH environment variable for IntelliJ IDEA on Mac OS X
- ${env.JAVA_HOME}: maven, intelliJ IDEA and Mavericks
- Setting global environment variables in IntelliJ IDEA and other test config goodies
macOS에서는 launchctl를 아래와 같이 사용하면 IntelliJ IDEA가 전역에서 사용하는 환경변수로 사용할 수 있다. LUA SDK를 찾을 때 필요한 환경변수 등으로 사용될 수 있다.
SQL dialect is not
Setting - Project Setting - SQL Dialects 항목에서 화면에서의 붉은 사각형 부분인 SQL Dialect 부분에서 사용하는 DBMS를 선택하시면 됩니다.
Cannot determine Java VM executable in selected JDK
- Stackoverflow - What's the reason for “Error:Cannot determine Java VM executable in selected JDK”?
- Error:Cannot determine Java VM executable in selected JDK
dwm 에서 검은화면
cannot resolve scss file vue-component
WebStorm계열에서 vue-component 사용 시, scss 의 @import
구문에서 Cannot resolve file ...
하는 에러가 날 경우:
메뉴에서 Detect webpack configuration files for module resolution
항목을 Automatically
로 수정한 후, webpack 실행 대화상자가 뜨면 실행한다.
Missing default translation file
vue-i18n-loader 사용해, SFC로 i18n 적용하면 저런 경고가 뜬다. 만약, i18n support 플러그인을 설치했다면 그냥 지우자.
Dynamic Problem 이 체크되지 않는 이슈
코드 편집시 라이브로 코드에 대한 문제점이 체크되지 않을 때 확인해 보자.
다음 그림과 같이 Highlight level
이 Syntax
또는 None
일 경우 클릭하여 All Problem
으로 변경하면 된다.
| | |
Highlight level: Syntax 고정 이슈
- Since updating to 2020.3 highlighting level always defaults to Syntax not "all problems" – IDEs Support (IntelliJ Platform) | JetBrains
- Reader mode | PyCharm
다음 그림과 같이 Highlight level
이 Syntax
로 고정될 경우:
Intellij_reader_mode_screenshot.png
이 것을 All Problem
으로 바꾸고 싶다면, Shift+Ctrl+Alt+H
을 클릭하거나 초록색 체크표시를 마우스 좌클릭 하면 된다.
만약 기본 옵션으로 바꾸고 싶다면 Reader Mode를 끄면 된다. 끄는 방법은 Settings > Editor > Reader Mode > Enable Reader Mdoe
를 체크 해제하면 된다.
ideaVim 에서 갑자기 ESC 키가 안먹는 현상
ideaVim의 2.6.x
버전에서 버그 발생함. 2.5.1
로 직접 다운로드 받아 설치했다.
Twig를 사용한 Nunjucks 파일 연동
- nunjuks templating language – IDEs Support (IntelliJ Platform) | JetBrains
- syntax highlighting - Integrating Nunjucks with IntelliJ IDEA / Webstorm - Stack Overflow
Configure a custom extension with Twig files. It's a template engine with similar syntax (but for PHP).
- add Twig Support plugin if necessary
- Go to
Settings -> Editor -> File
Types and add find Twig - Add the custom pattern
*.njk
.
갑자기 Ctrl+P (Parameter Info) 가 안먹히는 상황
PyCharm 업데이트 직후 위 현상이 나온다.
Settings > Keymap
에 들어가서 검색어에 Parameter 라고 치면 나온다. Add Keyboard Shortcut
클릭하면 충돌되는 기능이 보인다. 해당 숏컷을 끄자.
나의 경우, Show Hide Path Input 가 충돌되었다.
Linux 버전에서 Debugging Mode 실행 시 Breakpoint 히트 되었을 때 화면 클릭이 안되는 현상
WARNING |
현재 정확한 원인은 파악되지 않았다. |
x11, pygame with pyimgui 에서 특정화면(갱신되어야 할 화면)의 메인 렌더링 루프가 한번도 안돌아간 상태(화면 갱신 없이) 바로 브레이크 포인트에 히트되면 안되더라. 1회 이상 돌려야 하더라.
또는 버튼 클릭 이벤트(윈도우 포커스 전환) 직후 디버깅 히트되면 문제가 발생되는듯 하기도 한다.
그래서 다음의 순서로 디버깅을 진행해야 한다.
- (디버깅 중인)어플리케이션에서 디버깅할 화면으로 이동.
- PyCharm 에디터 화면으로 이동.
- Breakpoint 찍기 (이 때 찍자마자 걸려야 한다)
마지막 부분이 중요한데, PyCharm 과 어플리케이션의 포커스 전환이 일어나면 안된다.
이 때 참조할 옵션이 있는데, Settings 화면에서 "Build, Execution, Deployment -> Debugger" 트리 아이템 선택 후 "Focus application on breakpoint" 버튼을 클릭하면 자동으로 포커스 전환되는데 이걸 꺼도 동일한 현상 발생되더라.
프로그램이 종료되지 않는다면 F9 를 클릭하여 Continue 한면 된다.
See also
Favorite site
How to use
Tip
- IntelliJ의 .http를 사용해 Postman 대체하기
- dlsniper/docker-intellij (Docker image for IntelliJ IDEA Community, Go and Go plugin)