mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
cmd-shift-k: super crappy 'show keybindings' extension
This commit is contained in:
1
extensions/showkeybindings/index.coffee
Normal file
1
extensions/showkeybindings/index.coffee
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require 'showkeybindings/showkeybindings'
|
||||
2
extensions/showkeybindings/key-bindings.coffee
Normal file
2
extensions/showkeybindings/key-bindings.coffee
Normal file
@@ -0,0 +1,2 @@
|
||||
showkeybindings:
|
||||
'cmd-shift-k': (showkeybindings) => showkeybindings.toggle()
|
||||
27
extensions/showkeybindings/showkeybindings.coffee
Normal file
27
extensions/showkeybindings/showkeybindings.coffee
Normal file
@@ -0,0 +1,27 @@
|
||||
_ = require 'underscore'
|
||||
$ = require 'jquery'
|
||||
fs = require 'fs'
|
||||
|
||||
Extension = require 'extension'
|
||||
Modal = require 'modal'
|
||||
|
||||
module.exports =
|
||||
class Showkeybindings extends Extension
|
||||
constructor: ->
|
||||
atom.keybinder.load require.resolve "showkeybindings/key-bindings.coffee"
|
||||
atom.on 'project:open', @startup
|
||||
|
||||
startup: (@project) =>
|
||||
html = '<h1>Keybindings</h1>'
|
||||
for name, bindings of atom.keybinder.keymaps
|
||||
html += "<h3>#{name}</h3>"
|
||||
html += "<ul>"
|
||||
for binding, method of bindings
|
||||
html += """
|
||||
<li>#{atom.keybinder.bindingFromAscii(binding)} - #{method}</li>
|
||||
"""
|
||||
html += "</ul>"
|
||||
@pane = new Modal html
|
||||
|
||||
toggle: ->
|
||||
@pane?.toggle()
|
||||
Reference in New Issue
Block a user