WebStorm 설정

webstorm


WebStorm 설정하기

목차

  1. 첫 설치
  2. 단축키 셋팅
  3. Prettier 셋팅
  4. 테마셋팅
  5. 버벅거림 셋팅
  6. 웹스톰 처음으로 초기화하기

첫 설치

  • Material Theme 만 설치

    ( 그리고 cmd + , - Plugins 에서 Material Theme 비활성화, 테마 자체는 Dark Purple Theme를 사용.

    테마에 있는 몇몇기능 때문에 설치. )



단축키 셋팅

탭 셋팅

shift 2번 - Editor Tabs

  • Close All : cmd + shift + W
  • Split and Move Right : control + option + .
  • Unsplit : control + option + ,
  • Move To Opposite Group : shift + control + .

Editor - General - Editor Tabs

  • Mark modified (*) 체크

JavaScript

cmd + , - Editor - Live Templates - JavaScript

Abberviation Description Define
cl console.log() JavaScript & TypeScript
1
console.log($ITEM$)

Edit Template Variables : 미설정


CSS

cmd + , - Editor - Live Templates - +버튼 - Templete Group - CSS입력

Abberviation Description Define
rscss Reset CSS CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
/* ::-moz-selection {
background: #0288d1;
color: #ffffff;
}
::selection {
background: #0288d1;
color: #ffffff;
} */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: inherit;
font-style: normal;
font-weight: inherit;
font-size: inherit;
line-height: inherit;
letter-spacing: 0em;
text-decoration: inherit;
color: inherit;
vertical-align: top;
outline: none;
}
a,
address,
area,
article,
aside,
audio,
b,
body,
br,
button,
canvas,
caption,
cite,
code,
col,
colgroup,
dd,
del,
div,
dl,
dt,
em,
embed,
fieldset,
figcaption,
figure,
footer,
form,
frame,
frameset,
h1,
h2,
h3,
h4,
h5,
h6,
head,
header,
hr,
html,
i,
iframe,
img,
ins,
input,
label,
legend,
li,
link,
map,
meta,
nav,
object,
ol,
p,
pre,
q,
rp,
rt,
ruby,
s,
script,
section,
select,
source,
span,
strong,
style,
sub,
summary,
sup,
table,
tbody,
td,
textarea,
tfoot,
th,
thead,
time,
title,
tr,
u,
ul,
video {
margin: 0;
padding: 0;
font-family: inherit;
font-style: normal;
font-weight: inherit;
font-size: inherit;
line-height: inherit;
text-decoration: inherit;
color: inherit;
vertical-align: top;
outline: none;
}
html {
width: 100%;
height: 100%;
font-weight: 300;
font-size: 10px;
line-height: 1.2;
-ms-touch-action: manipulation;
touch-action: manipulation;
/* -webkit-overflow-scrolling: touch; */
}
body {
width: 100%;
height: 100%;
font-family: 'Roboto', sans-serif;
color: #222;
background: #fff;
-webkit-font-smoothing: antialiased;
-webkit-tap-highlight-color: rgba(31, 26, 26, 0);
-webkit-text-size-adjust: 100%;
-webkit-print-color-adjust: exact;
}
ul,
ol,
li {
list-style: none;
}
img,
hr {
border: none;
}
p {
max-height: 999999px;
}
table {
max-width: 100%;
border-spacing: 0;
table-layout: fixed;
}
th,
td {
vertical-align: middle;
}
select {
-webkit-appearance: none;
appearance: none;
border-radius: none;
-webkit-border-radius: 0;
}
select::-ms-expand {
display: none;
}
::-webkit-input-placeholder {
color: #777777;
}
::-moz-placeholder {
color: #777777;
}
:-ms-input-placeholder {
color: #777777;
}
:-moz-placeholder {
color: #777777;
}
input[type='text'] {
border-radius: 0;
}
button,
input[type='file'],
input[type='image'],
input[type='reset'],
input[type='button'],
input[type='submit'] {
border: 1px solid #eee;
background: #fff;
cursor: pointer;
-webkit-appearance: none;
appearance: none;
border-radius: none;
}
label {
cursor: pointer;
}
fieldset,
iframe {
border: none;
}
sup,
sub {
line-height: 1;
}
a:link {
text-decoration: none;
color: inherit;
}
a:hover {
text-decoration: none;
color: inherit;
}
a:visited {
text-decoration: none;
color: inherit;
}
a:active {
text-decoration: none;
color: inherit;
}
a:focus {
text-decoration: none;
color: inherit;
}
@media all and (max-width: 768px) {
html {
font-size: 8px;
}
}

Edit Template Variables : 미설정


React

cmd + , - Editor - Live Templates - React


Abberviation Description Define
tsc Typescript React Class JavaScript & TypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React, { Component } from 'react'

interface Props {

}
interface State {

}

export default class $TM_FILENAME_BASE$ extends Component<Props, State> {
state = {}

render() {
return (
<div>
$END$
</div>
)
}
}

Edit Template Variables

Name Expression Default value
TM_FILENAME_BASE capitalize(camelCase(fileNameWithoutExtension())) “”

Abberviation Description Define
tscc Typescript React Route Class JavaScript & TypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from 'react';
import { RouteComponentProps } from 'react-router';
interface IState {
$END$
}
interface IProps extends RouteComponentProps {
$END$
}
export class $TM_FILENAME_BASE$ extends React.Component<IProps, IState> {
state: IState;
constructor(props: IProps) {
super(props);
this.state = {
}
}
render() {
return {};
}
componentDidMount(): void {}
componentWillUpdate(nextProps: Readonly<IProps>, nextContext: any): void {}
componentWillUnmount(): void {}
}
// mobx
// export default inject('')(observer($TM_FILENAME_BASE$));

Edit Template Variables

Name Expression Default value
TM_FILENAME_BASE capitalize(camelCase(fileNameWithoutExtension())) “”

Abberviation Description Define
tsf Typescript React Function JavaScript & TypeScript
1
2
3
4
5
6
7
8
9
import React, { useEffect } from 'react'

export interface $TM_FILENAME_BASE$Props {}

const $TM_FILENAME_BASE$: React.FC<$TM_FILENAME_BASE$Props> = ({ children }) => {
return <div>$END$</div>;
}

export default $TM_FILENAME_BASE$;

Edit Template Variables

Name Expression Default value
TM_FILENAME_BASE capitalize(camelCase(fileNameWithoutExtension())) “”

Abberviation Description Define
tsfc Typescript React Route Function JavaScript & TypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as React from 'react';
import { RouteComponentProps } from 'react-router';
// import { observer } from 'mobx-react';
interface RouteParams {
$END$
}
interface IProps {
$END$
}
export const $TM_FILENAME_BASE$: React.FC<RouteComponentProps<RouteParams> & IProps> = () => {
return (
<>
</>
);
};
// mobx
// export default observer($TM_FILENAME_BASE$);

Edit Template Variables

Name Expression Default value
TM_FILENAME_BASE capitalize(camelCase(fileNameWithoutExtension())) “”

Abberviation Description Define
tss Typescript React Styled Component JavaScript & TypeScript
1
2
3
4
5
6
7
8
9
10
import React, { useEffect } from 'react';
import styled from 'styled-components';
export interface $TM_FILENAME_BASE$Props {
$END$
}
const $TM_FILENAME_BASE$Styled = styled.div.attrs({})<$TM_FILENAME_BASE$Props>``;
const $TM_FILENAME_BASE$: React.SFC<$TM_FILENAME_BASE$Props> = ({ children }) => {
return <$TM_FILENAME_BASE$Styled></$TM_FILENAME_BASE$Styled>;
}
export default $TM_FILENAME_BASE$;

Edit Template Variables

Name Expression Default value
TM_FILENAME_BASE capitalize(camelCase(fileNameWithoutExtension())) “”

Abberviation Description Define
tssmq Typescript Styled-Component Mediq Query JavaScript & TypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { css } from 'styled-components';
const sizes = {
desktop: 1025,
tablet: 1024,
mobile: 768,
};
const sizeCheck = (label: string) => {
if (label === 'desktop') return `all and (min-width: ${sizes[label]}px)`;
if (label === 'tablet')
return `all and (min-width: ${+sizes['mobile'] + 1}px) and (max-width: ${
sizes[label]
}px)`;
if (label === 'mobile') return `all and (max-width: ${sizes[label]}px)`;
};
const media = Object.keys(sizes).reduce((points: any, label) => {
points[label] = (literals: TemplateStringsArray, ...args: any[]) => css`
@media ${sizeCheck(label)} {
${css(literals, ...args)}
}
`;
return points;
}, {} as Record<keyof typeof sizes, (literals: TemplateStringsArray, ...args: any[]) => string>);
export default media;import { css } from 'styled-components';
const sizes = {
desktop: 1025,
tablet: 1024,
mobile: 768,
};
const sizeCheck = (label: string) => {
if (label === 'desktop') return `all and (min-width: ${sizes[label]}px)`;
if (label === 'tablet')
return `all and (min-width: ${+sizes['mobile'] + 1}px) and (max-width: ${
sizes[label]
}px)`;
if (label === 'mobile') return `all and (max-width: ${sizes[label]}px)`;
};
const media = Object.keys(sizes).reduce((points: any, label) => {
points[label] = (literals: TemplateStringsArray, ...args: any[]) => css`
@media ${sizeCheck(label)} {
${css(literals, ...args)}
}
`;
return points;
}, {} as Record<keyof typeof sizes, (literals: TemplateStringsArray, ...args: any[]) => string>);
export default media;

Edit Template Variables : 미설정



프리티어 셋팅

cmd + , - Plugins - Prettier 설치 확인

cmd + , - Languages & Frameworks - JavaScript - Prettier

Run on save for files : 체크

패턴 : {*/,*}.{js,ts,jsx,tsx,css,scss,sass}


위 셋팅으로 cmd + s 시 프리티어가 미적용될 경우, 파일 워처 설정해야함.

cmd + , - Tools - File Watchers - + 버튼 누르고

JS , JSX , TS , TSX , CSS , SASS , SCSS 전부 프리티어 만들고 적용.



플러그인 셋팅

  1. Nyan Progress Bar
  2. React Snippets
  3. Styled Components & Styled JSX
  4. Rainbow Brackets
  5. Material Theme UI 또는 Dark Purple Theme
  6. Atom Material Icons
  7. Quick Notes

Material Theme 설치 시 설정

control + ~ - Material Theme UI

위 버튼이 안먹을 경우

View - Quick Switch Schema- Material Theme UI



버벅거림 설정

  1. shift 2번 - memoryIndicator 검색 - 설정

  2. Help - Edit Custom VM Options

  3. -Xms128m-Xms512m 로 변경 (컴퓨터 사양따라 조절)

  4. -Xmx750m-Xmx4096m 로 변경 (컴퓨터 사양따라 조절)

  5. 아래 두줄 추가

    1
    2
    -Dawt.useSystemAAFontSettings=lcd
    -Dawt.java2d.opengl=true
  6. 재시작



웹스톰 처음으로 초기화하기

shift 2번 - Restore the default WebStorm settings 검색

Share