Add command to open user config in an editor

This commit is contained in:
Kevin Sawicki
2014-01-17 14:26:04 -08:00
parent ddad42432b
commit 905f628b79
3 changed files with 9 additions and 0 deletions

View File

@@ -98,6 +98,10 @@ class Config
_.extend hash, defaults
@update()
# Public: Get the path to the config file being used.
getUserConfigPath: ->
@configFilePath
# Public: Returns a new {Object} containing all of settings and defaults.
getSettings: ->
_.deepExtend(@settings, @defaultSettings)

View File

@@ -125,6 +125,7 @@ class WorkspaceView extends View
@command 'window:open-your-stylesheet', => @model.openUserStylesheet()
@command 'window:open-your-keymap', => @model.openUserKeymap()
@command 'window:open-your-config', => @model.openUserConfig()
# Private:
handleFocus: (e) ->

View File

@@ -46,6 +46,10 @@ class Workspace extends Model
openUserKeymap: ->
@open(atom.keymap.getUserKeymapPath())
# Private: Open ~/.atom/config.cson or ~/.atom/config.json
openUserConfig: ->
@open(atom.config.getUserConfigPath())
# Public: Asynchronously opens a given a filepath in Atom.
#
# * filePath: A file path