When I am in PuTTY, and I execute a bunch of commands, I often want to use the same command I just used. So I press the "Up" arrow. The last command now shows up, but I want to edit it a little.
I couldn't figure out how to edit it, until I realised it let me edit it using "vi" commands.
Does anyone know what setting in PuTTY I have to change to allow me to edit it normally instead of having to use "vi" commands?
Thanks
41 Answer
This is not the PuTTy issue, It's caused by bash readline.
I think the result would be looks like mine if you execute the following two commands:
$ bind -v | grep keymap
set keymap vi-insert
$ bind -v | grep editing-mode
set editing-mode viThat means, the bash shortcut was set as vi-like (default is emacs-like). If you want to revert to original, input the following two commands:
set editing-mode emacs
set keymap emacsAnd re-start your PuTTy. I think everything will be fine.
However, if this is the public server, and many people are all using it. You can try find previous-history by using ctrl + p. Or find the shortcuts about previous-history by:
$ bind -p | grep previous-history
"\C-p": previous-history
"\eOA": previous-history
"\e[A": previous-history 0