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})")