code-mirror & node-webkit based.
hydro some/folder
Put a .hydro.coffee in project root. It may look ~like:
fs = require 'fs'
coffee = require 'coffee-script'
{exec} = require 'child_process'
module.exports = (editor) ->
# compile CoffeeScript to lib folder
editor.on 'change', (instance, changeObj) ->
return unless instance.file.ext is 'coffee'
coffee.compile instance.getValue(), (js) ->
fs.writeFile "lib/#{instance.file.base}.js", js, (err) ->
# refresh chrome on file change
url = "file://" + fs.currentPath() + "/index.html"
editor.on 'change', (instance, changeObj) ->
fs.writeFile instance.file, instance.getValue(), (err) ->
exec "chromix load #{url}", (err, stdout, stderr) ->~/.config/hydrogen/user.coffee - works like the one above, ex:
exports.options =
theme: 'solarized dark'
lineNumbers: true
# ...
exports.init = (editor) ->
config =
coffee:
mode: 'coffee'
# use coffee-lint
md:
mode: 'markdown'
theme: 'solarized light'
extraKeys: null # TODO Ctrl+B bolds and so on...
# TODO live preview in the browser...
editor.on 'swapDoc', (instance, oldDoc) ->
if instance.file.ext in config
instance.setOptions config[instance.file.ext]Instead: easy to [re]open recent & any file.
...or does it?
