Skip to content

Instantly share code, notes, and snippets.

@bynaki
Created November 24, 2015 14:09
Show Gist options
  • Save bynaki/68fd40e8da69cab374c0 to your computer and use it in GitHub Desktop.
Save bynaki/68fd40e8da69cab374c0 to your computer and use it in GitHub Desktop.
Atom :: The Init File

Atom :: The Init File

Atom이 실행된후, ~/.atom 디렉토리에 있는 init.coffee 파일이 실행되며, 너에게 원하는 대로 만든 CoffeeScript 코드를 실행할 기회를 준다. 너는 Atom > Open Your Init Script 메뉴에서 init.coffee 파일을 열수있다. 이 파일은 또한 init.js 이름 지어질 수 있으며 JavaScript 코드를 포함할 수 있다.

예를 들어, 만약 너가 Audio Beep 활성화 하고 싶다면, 너는 밑에 코드를 너의 init.coffe 파일에 추가하면 Atom을 실행할 때마다 Beep가 울릴것이다.

code:

atom.beep()

더 실용적인 예제를 보자.

code:

atom.commands.add 'atom-text-editor', 'markdown:paste-as-link', ->
  return unless editor = atom.workspace.getActiveTextEditor()

  selection = editor.getLastSelection()
  clipboardText = atom.clipboard.read()

  selection.insertText("[#{selection.getText()}](#{clipboardText})")
{"noteId":"15139d37294-6cfa862a","main":"15139d37294-6cfa862a.md","title":"Atom :: The Init File"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment