       NotationalVelocityView = require './notational-velocity-view'
       @notationalVelocityView = new NotationalVelocityView(state.notationalVelocityViewState)
     @notationalVelocityView
+
+  autosave: (paneItem) ->
+    return unless paneItem?.getURI?()?
+    return unless paneItem?.isModified?()
+    uri = paneItem.getURI()
+    return unless uri.indexOf(@rootDirectory) == 0
+    return unless fs.isMarkdownExtension(path.extname(uri))
+    paneItem?.save?()
+
+  autosaveAll: ->
+    @autosave(paneItem) for paneItem in atom.workspace.getPaneItems()

  notationalVelocityView: null

  activate: (state) ->
    # Events subscribed to in atom's system can be easily cleaned up with a
    # CompositeDisposable
    @subscriptions = new CompositeDisposable

path = require 'path'
fs = require 'fs-plus'
{CompositeDisposable, Disposable} = require 'atom'

module.exports =
  config:
