Atom 에디터 팁 #1

파일 이름에 맞는 문법 하이라이팅 강제하기

예를 들어 마크다운 편집을 주로 하는 경우에 .txt 파일을 language-markdown가 문법 하이라이팅을 해주길 원할 수 있다. 하지만 language-markdownmarkdown, md, mdown, mkd, mkdown, rmd, ron, emdee 같은 확장자를 가진 파일만 인식한다. .txt 파일을 열면 Plaintext로 인식하므로 매번 Markdown으로 바꿔줘야 한다. 이런 번거로움을 없애는 가장 간편한 방법은 file-types 플러그인을 이용하는 것이다.

"file-types":
  "\\.txt$": "text.md"

이렇게 하면 .txt 파일을 열 때마다 Markdown 파일로 인식해서 language-markdown이 문법 하이라이팅을 적용한다. 개인적으로는 .txt 파일 외에도 file-types 플러그인을 사용한다.

"file-types":
  ".remarkrc": "source.json"
  Brewfile$: "source.rb.hombrew-formula"
  "Dockerfile.*$": "source.dockerfile"
  "\\.txt$": "text.md"
  • .remarkrcremark-lint의 설정 파일인데 다른 ~rc 파일과 달리 JSON 포맷이다.
  • BrewfileBrew Bundle 파일이라 language-hombrew-formula를 적용한다.
  • CODESHIP 빌드 파일은 일반적인 Dockerfile과 달리 파일 이름이 Dockerfile.build인 경우가 많다. Dockerfile로 시작하는 파일 이름은 모두 Dockerfile과 동일하게 처리하게 했다.
Author Details
Kubernetes, DevSecOps, AWS, 클라우드 보안, 클라우드 비용관리, SaaS 의 활용과 내재화 등 소프트웨어 개발 전반에 도움이 필요하다면 도움을 요청하세요. 지인이라면 가볍게 도와드리겠습니다. 전문적인 도움이 필요하다면 저의 현업에 방해가 되지 않는 선에서 협의가능합니다.
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments