elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Provide a key binding for inserting the symbolic name of a key

Open krader1961 opened this issue 5 years ago • 2 comments

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.

krader1961 avatar Nov 09 '20 05:11 krader1961

Is this a slightly different version of #1058?

xiaq avatar Feb 28 '22 01:02 xiaq

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.

krader1961 avatar Feb 28 '22 02:02 krader1961