In bash shell, how can I replace a character under the cursor with another character ?
In the below example , after I typed the following line, I realized that I meant 7013 and not 2013. So I move the cursor to the left and keep it on top of 2 (of 2013) and I want to replace 2 with 7. How can I do that ?
$ echo hello world 2013
This question is not about replacing characters within vi/vim/emacs
A video example (for more clarity)
In the below video, how is this guy changing 2010 to 2011 instantly ? He also changes 2011 to 2012 , ... etc . I tried googling and I couldn't find anything on this. Hence posting it here.
You move to the 0 , hit <Del Left> or <Ctrl-H>, and type 7 .
If you want to replace the char you're on, you'll have to switch bash 's readline library to "overwrite-mode". By default, this command is unbound, so you need to bind it, e.g.: