Skip to content

Commit

Permalink
docs: live template 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
meansoup committed May 9, 2024
1 parent 818ad26 commit 06d8597
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docs/91.dev-tools/intellij/2022-05-30-intellij_livetemplate.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: post
title: intellij 의미 없는 시간 줄이기 live template 편
sidebar_label: intellij 의미 없는 시간 줄이기 live template
sidebar_label: Intellij live template
parent: Intellij
grand_parent: Tools
permalink: /docs/dev-tools/intellij/live-template
Expand All @@ -10,36 +10,33 @@ sitemap:
---

intellij는 개발 시간을 단축할 수 있는 여러 기능들을 제공한다.
중에 가장 많이 사용하는 것 중 하나가 **live template**이다.
중 내가 가장 많이 사용하는 것 중 하나가 **live template**이다.

이게 뭔지는 중요하지 않다.
써보면 안다.

### 설정 확인하기
### live template 확인하기

1. (ctrl + alt + s) 로 settings 진입
2. Editor > Live Templates
3. 각 언어 확인

여기서 각 언어를 들어가면 intellij에서 기본적으로 제공하는 live template 들을 확인할 수 있다.
몇 개를 써보면 금방 감이 온다.
몇 개를 써보면 금방 감이 온다. 개발 시간을 단축시킬 수 있는 유용한 template 들이 많아서 template 리스트를 확인하는 것도 의미가 있다.

<div class="code-example" markdown="1" style="font-size: 0.8em">
예시
{: .label .label-yellow}

예를 들면 `sout` 이라고 입력하고 enter 혹은 tab을 치면 (설정에 따라 다름)
![live template basic](/images/post/dev-tools/intellij/live-template/live-template-basic.gif)

kotlin에서는 `println()`이,
java에서는 `System.out.println();`이 완성되는 것을 확인할 수 있다.
`sout`을 입력하고 enter 혹은 tab을 누르면 java에서는 `System.out.println();`이 완성된다.
</div>

이렇게 **자주 쓰이는 template들을 약어로 등록하는 것을 live template이라고 한다**.
기본적으로 제공하는 것 중 `iter` 등을 사용하기도 한다.
이렇게 **자주 쓰이는 template들을 약어로 등록하는 것을 live template이라고 한다**.



### 설정하기
### live template 설정하기

나는 TDD 개발에서 자주 사용하는 given-when-then template을 사용한다.
이게 단순한데 매번 테스트 생성이 번거로워 live template으로 등록하는데 이걸 예로 들어보자.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 06d8597

Please sign in to comment.