Ideas for keybinding syntax

This commit is contained in:
Corey Johnson
2011-09-06 11:59:26 -07:00
parent df7a81c1ec
commit a9ff117e44

36
docs/keybindings.coffee Normal file
View File

@@ -0,0 +1,36 @@
# Keybinding ideas
# ----------------
# Are ctrl-v and ctrl-V different?
# Nested commands? Use timeout?
# Optional Regex, is that fucking crazy?
# Command/Control/Option or cmd/ctrl/alt
# How should we deal with scope?
keymap:
# Take some method found in the keymap scope?
'cmd-c': 'copyText'
# Take a block
'cmd-v': -> paste.someText()
# Can take a regex
# * how would this work with timeouts
# * how can this not look so hackish
# * do we even need this?
'cmd-/(\d+)/': (number) ->
window.switchTo(parseInt(number))
# Nested commands
'cmd-ctrl-r':
'r': -> run.something()
't': -> test.something()
# Switch modes? I don't like this syntax
'mode(normal):esc':
'j': 'moveDown'
'k': 'moveUp'
'a': ->
goto.endOfLine()
keybindingMode('normal')
'mode(insert):i':
'delete': 'delete'