BASH_UNDOREDO(1)            General Commands Manual           BASH_UNDOREDO(1)



NAME
       bash_undoredo - expand bash bindcmd 'undo' to 'undo/redo'

SYNOPSIS
       bash_undoredo [-hHV]
       bash_undoredo [-Q]

TL_DR
       ~$ bash_undoredo -Q #>> output corecode

       #--- ~/.bashrc
       (..your ini...)
       (..copy the '-Q' output funcs)
         #--prepare callback
       bind '"\C-org_undo": undo ' #>> need the readline built-in 'undo'
       bind -x '"\C-bur_undo": bur_undo'
       bind -x '"\C-bur_undo_sub": bur_undo_diff'

         #--main_keybind 'undo/redo'
       bind '"\b": "\C-bur_undo\C-org_undo\C-bur_undo_sub" ' #>> \b==ctrl-bksp
       bind -x '"\C-r": bur_redo'    #>> ctrl-r == redo
       #---

       #--test
       ~$ hello,wor(ld)    #-- input str then del 2char (ld)
       ~$ hello,worl  #-- undo: ctrl-bs
       ~$ hello,world #-- undo: ctrl-bs
       ~$ hello,worl  #-- redo: ctrl-r
       ~$ hello,wor   #-- redo: ctrl-r



OPTIONS
       -hHV   help, version

       -Q     output corecode

DESCRIPTION
       bash  'readline'  has  'undo'  cmd  for keybind but 'redo' doesnt. this
       script provides 'undo/redo' functions.


EXIT_STATUS
       suc/fail == 0/not0 (raise err/emsg if fatal)


NOTES
        rollback history size is 100, hardcoded.
        this script uses names 'bur_XX' for var/funcs


COMPAT
       posix-shell

COPYRIGHT
       Copyright (C) 2023 Momi-g, AGPLv3+

VERSION
       2023-06-25 v1.0.0 (2023-06-25 v1.0.0)

SEE_ALSO
       bash(1), readline(3)



                                                              BASH_UNDOREDO(1)
