#12 Allow history expansion of elements to the right of cursor

open
nobody
None
5
2013-02-13
2013-02-13
Thor Andreassen
No

Make history expansion of current line work with elements to the right of cursor.

For example expand !#2 or !#1 to somefile in the following example:

$ mv _ somefile

Note cursor position is marked with an underscore.

Discussion

  • Bart Schaefer
    Bart Schaefer
    2013-02-13

    Building in this sort of "knowledge" for selected commands is not scalable, and doing so in a general way would require adding semantic analysis to the spelling checker. The completion system already provides this kind of analysis, so we recommend using the _correct completer instead of the CORRECT_ALL option when you want this kind of specific control.