ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Atom] plain-simple 패키지 한국어 추가 및 색상 변경
    IDE & 에디터 2016. 10. 18. 10:31


    먼저 plain-simple 패키지를 받은 다음 소스코드 보기를 눌러 패키지를 확인

    다음 grammers 폴더 아래 plain-simple.cson 파일을 아래와 같이 수정

    'scopeName': 'text.plain.simple'
    'name': 'Plain Simple Text'
    'fileTypes': [
      'txt'
      'log'
      'yml'
      'yaml'
      ''
    ]
    'patterns': [
      {'include': '#timestamps'}
      {'include': '#addresses'}
      {'include': '#text'}
    ]
    'repository':
      'timestamps':
        'patterns': [
          {
    		# Dates
            'match': '(0[0-9]|1[0-9]|2[0-3])\\:([0-5][0-9])((?:\\:)[0-5][0-9](\\.\\d+)?)?'
            'name': 'constant.numeric'
          }
          {
    		# Timestamps
            'match': '(\\d{1,4}([./-])\\d{1,2}\\2\\d{1,4})'
            'name': 'constant.numeric'
          }
        ]
      'addresses':
        'patterns': [
          {
    		# Windows-paths
            'match': '((?:[a-zA-Z]:)|(?:\\\\{2}\\w[-\\w]*)\\$?)\\\\(?!\\.)((?:(?![\\\\/:*?<>"|])(?![.\\x20](?:\\\\|$))[\\x20-\\x7E])+\\\\(?!\\.))*((?:(?:(?![\\\\/:*?<>"|])(?![ .]$)[\\x20-\\x7E])+)\\.((?:(?![\\\\/:*?<>"|])(?![ .]$)[\\x20-\\x7E]){2,15}))?'
            'name': 'keyword'
          }
          {
    		# IP-addresses
            'match': '(\\d{1,3}(\\.)\\d{1,3}\\2\\d{1,3}\\2\\d{1,3})'
            'name': 'keyword'
          }
          {
    		# URL
            'match': '\\b[a-z\-]+:\/\/[^,)\\s]+'
            'name': 'keyword'
          }
        ]
      'text':
        'patterns': [
          {
    		# Headings
            'match': '^(?:\\s*)(\\[\\b.+\\b\\])(?:\\s*)$'
            'name': 'text.plain.simple.plainsimple-heading'
          }
          {
    		#  Numbers
            'match': '([0-9])'
            'name': 'text.plain.simple.plainsimple-number'
          }
          {
    		# List Bullets
            'match': '^(?:\\s*)(\\*|\\d+\\)|\\§\\d*)?(?:\\s+)'
            'name': 'string'
          }
          {
    		# Emphasized Words
            'match': '(?:\\s+)([\\*|_]+)(?:(?=(\\\\?))\\2.)*?\\1'
            'name': 'text.plain.simple.plainsimple-emphasize'
          }
          {
    		# Citations
            'match': '(?<!\\w)[“"\'].*?["”\'](?!\\w)'
            'name': 'constant.other.symbol'
          }
          {
            # 한글
            'match': '([ㄱ-ㅎ가-힣])'
            'name': 'text.plain.simple.plainsimple-korean'
          }
          {
             # 특수 기호
             'match': '([~?!@\#$%<>^&*\()\-=+_\’\{}])'
             'name': 'text.plain.simple.plainsimple-symbols'
          }
      ]


    그 다음 styles폴더 아래에 plain-simple.less 파일을 아래와 같이 수정

    @import 'ui-variables';
    atom-text-editor::shadow, .text .plain .simple {
      .plainsimple-heading {
        color: @text-color-info;
      }
      .plainsimple-number {
        color: @text-color-warning;
      }
      .plainsimple-emphasize {
        color: @text-color-success;
      }
      .plainsimple-citation {
        color: @text-color-highlight;
      }
      .plainsimple-korean {
          color:#777;
      }
      .plainsimple-symbols {
          color:@text-color-error;
      }
    }


    무단으로 수정해서 사용하는 것이기 때문에 배포는 안됨


    댓글