Provide a key binding for inserting the symbolic name of a key
While working on a resolution for issue #1163 @xiaq expressed a desire to have a mechanism for inserting symbolic key names when pressing a key (with optional modifiers). For example, if I press Alt-Enter the string Alt-Enter should be inserted into the command buffer rather than performing the action bound to the key. This could be modeled on the Ctrl-V binding ($edit:insert-raw~). The new function might be bound to Alt-V (to mirror Ctrl-V) or, perhaps, Alt-K.
An alternative is to make $edit:insert-raw~ context aware so that it inserts the symbolic key name when used in an indexing context. That would cover the interactive use case of altering editor key bindings that @xiaq had in mind during feedback on my P.R. for issue #1163. This context aware behavior might, however, be a bit too magical.
Is this a slightly different version of #1058?
Is this a slightly different version of https://github.com/elves/elvish/issues/1058?
Yes. I'm also inclined to close this as "will not implement" since it has very limited usefulness and would be hard for a user to discover (and remember how to invoke the behavior) unless it was implemented by making $edit:insert-raw~ context aware. Which also limits the usefulness of the feature. I prefer a mechanism like discussed in issue #1058 even now after having switched from Fish to Elvish over three years ago.