Code refactorings are used to restructure your existing code without changing its external behaviour. The most popular is probably the Rename refactoring, which changes the name of a variable, method, class, etc. Refactoring is an essential technique to maintain the quality of your code, make it more readable and easier to maintain and reuse.

CLion offers you a set of code refactorings, which track down and correct the affected code references automatically. This means you can always be sure that your project will work correctly, even after large-scale changes. The list of refactorings available in CLion includes:

  • Rename (Shift+F6) renames symbols, automatically correcting all references in the code for you.
  • Change Signature (Ctrl+F6 on Windows/Linux, Cmd+F6 on OS X) helps you add/remove/reorder function parameters, change the result type or update the name of the function, all usages will be fixed as well.
  • Move (F6) moves files or directories, as well as methods, variables or constants.
  • Copy (F5) allows you to create a copy of file or directory.
  • Safe Delete (Alt+Delete on Windows/Linux, Cmd+Delete Forward on OS X) safely removes files and symbols from your code.
  • Inline (Ctrl+Alt+N on Windows/Linux, Alt+Cmd+N on OS X) replaces redundant variable usage/method calls with its initializer/declaration.
  • Extract refactoring – CLion analyses the block of code where the refactoring was invoked, detects input and output variables, together with the usages of the selected expression to replace them with the newly created:
    • Variable (Ctrl+Alt+V on Windows/Linux, Alt+Cmd+V on OS X)
    • Constant (Ctrl+Alt+C on Windows/Linux, Alt+Cmd+C on OS X)
    • Parameter (Ctrl+Alt+P on Windows/Linux, Alt+Cmd+P on OS X)
    • Typedef (Ctrl+Alt+K on Windows/Linux, Alt+Cmd+K on OS X)
    • Define (Ctrl+Alt+D on Windows/Linux, Alt+Cmd+D on OS X)
    • Method (Ctrl+Alt+M on Windows/Linux, Alt+Cmd+M on OS X)
  • Pull Members Up safely moves class members to a superclass.
  • Push Members Down safely moves class members to a subclass.

You can use Refactor This (Ctrl+Alt+Shift+T on Windows/Linux, Ctrl+T on OS X) to get the list of the refactorings available in the current scope.

Watch CLion’s refactorings in action:

쓸만한게 있으면 계속 업데이트 됩니다. 


Copy as Html 

http://plugins.jetbrains.com/plugin/190

자바 소스 코드를 html로 변경해줍니다. 

블로그나 인터넷 게시판에 html태그로 소스를 보기 좋게 해주기때문에 쓸만한 듯 싶습니다.



'tools > intellij' 카테고리의 다른 글

Intellij 설정  (0) 2014.09.17
intellij 단축키  (0) 2014.09.17

계속 업데이트 예정 

 

1. 주석이나 문자열 스펠링 체크 해제 (주석및 문자열 안의 스펠링 검사 해제)

  설정창 들어가서 검색 'Spellchecker'  체크 해제 

 

2. 이클립스에 비해 인텔리센스가 디폴트 설정도 편하지만 visual studio의  Visual Assist랑 맞먹을려면!!? 

설정창 들어가서  검색 Code Completion 에서 Case sensitive completion  "None"로 변경

 코드 자동완성 발동조건에 대소문자 구분안하게 된다.

-개인적으로 이클립스처럼 Ctrl + Shift 키를 안눌러도 자동으로 발동되는 것이 제일 마음에 든다 -_-;;;

 

3. 띄어쓰기 탭으로 인식 

 설정창 tab으로 검색및 CodeStyle 하부메뉴의 각 언어에서 Use Tab character  및 smart tabs 체크

 

4. 자동 정렬시 한줄당 최고 글자수 설정

  settings에서  right margin 검색

   Project settings -> Code Style -> General -> Right margin 값 설정

 

 

 

 

 

필요에 따라 사용

* 다른 프로젝트에서 소스를 임포트를 했을때 기본 인코딩이 euc-kr일 경우 매소스마다 설정하기가 불편하다

설정창 File Encodings 검색 IDE Encoding 값 변경

 

 

intellij 가이드 링크

http://beyondj2ee.wordpress.com/2013/06/28/%ec%9d%b8%ed%85%94%eb%a6%acj-%ec%8b%9c%ec%9e%91%ed%95%98%ea%b8%b0-part4-getting-start-intellij-git/

'tools > intellij' 카테고리의 다른 글

Intellij Plugin  (0) 2014.09.17
intellij 단축키  (0) 2014.09.17

Editing
Ctrl + Space Basic code completion (the name of any class,method or variable)
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 + / 줄 단위 주석 토글
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 + NumPad+/- Expand/collapse code block
Ctrl + Shift + NumPad+ Expand all
Ctrl + Shift + NumPad- Collapse all
Ctrl + F4 Close active editor tab

 

 

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

 

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

 

 

Navigation
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 + E Recent files popup
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 + B or Ctrl + Click Go to declaration
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
F5 Copy
F6 Move
Alt + Delete Safe Delete
Shift + F6 Rename
Ctrl + F6 Change Signature
Ctrl + Alt + N Inline
Ctrl + Alt + M Extract Method
Ctrl + Alt + V Extract Variable
Ctrl + Alt + F Extract Field
Ctrl + Alt + C Extract Constant
Ctrl + Alt + P Extract Parameter

 

 

 

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 current 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

'tools > intellij' 카테고리의 다른 글

Intellij Plugin  (0) 2014.09.17
Intellij 설정  (0) 2014.09.17

+ Recent posts