mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Load all keymaps found in ~/.atom/keymaps
This commit is contained in:
@@ -28,6 +28,12 @@ class Keymap
|
||||
$(document).command 'open', => atom.open()
|
||||
$(document).command 'open-unstable', => atom.openUnstable()
|
||||
|
||||
loadBundledKeymaps: ->
|
||||
@loadDirectory(require.resolve('keymaps'))
|
||||
|
||||
loadUserKeymaps: ->
|
||||
@loadDirectory(fs.join(config.configDirPath, 'keymaps'))
|
||||
|
||||
loadDirectory: (directoryPath) ->
|
||||
@load(filePath) for filePath in fs.list(directoryPath)
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ windowAdditions =
|
||||
|
||||
@keymap = new Keymap()
|
||||
@keymap.bindDefaultKeys()
|
||||
@keymap.loadDirectory(require.resolve('keymaps'))
|
||||
@keymap.loadBundledKeymaps()
|
||||
@keymap.loadUserKeymaps()
|
||||
|
||||
@_handleKeyEvent = (e) => @keymap.handleKeyEvent(e)
|
||||
$(document).on 'keydown', @_handleKeyEvent
|
||||
|
||||
Reference in New Issue
Block a user