Skip to content

Instantly share code, notes, and snippets.

@kurogelee
Last active August 30, 2016 12:55
Show Gist options
  • Save kurogelee/9d814bd01afa02086ae526cdc24fbec9 to your computer and use it in GitHub Desktop.
Save kurogelee/9d814bd01afa02086ae526cdc24fbec9 to your computer and use it in GitHub Desktop.
Atomのinit.coffeeをinit.cljs(ClojureScript)で置き換える方法 ref: http://qiita.com/kurogelee/items/b198733771ae1c7e35ac
(.log js/console global.atom)
(.log js/console global.atom.commands)
(.. global.atom.commands
(add "atom-text-editor" "cljs:sample-linefirst"
#(.. global.atom.workspace
getActiveTextEditor
getLastCursor
moveToFirstCharacterOfLine)))
os = require 'os'
path = require 'path'
fs = require 'fs'
cljs = require 'clojurescript'
cljs.context.atom = atom
cljs.context.protoRepl = protoRepl
initCljs = path.join os.homedir(), '.atom/init.cljs'
fs.readFile initCljs, 'utf8', (err, data) ->
throw err if err
cljs.eval("(do #{data})")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment