3 ms·
"If you wanted to modify this in a traditional terminal emulator, you would probably use the up arrow to retrieve the last command, use the left arrow (or Ctrl-
by pmoriarty 10y ago
"If you wanted to modify this in a traditional terminal emulator, you would probably use the up arrow to retrieve the last command, use the left arrow (or Ctrl-Home) to get to the beginning of line to modify ‘rn’, then use the right arrow (perhaps in combination with Ctrl) to modify the second instance of folder 1."
Not so. You can just type "set -o vi" in your shell, and do pretty much what the OP does in emacs. So wanting to do this kind of editing in the shell is not really a very good reason to switch to emacs. There are much better reasons for doing that.
- gkya 10y agoExcept the shell session is a buffer in emacs and you can do anything in it.
- deleted 10y ago[deleted]
- pault 10y agoWell, there's vimshell: https://github.com/Shougo/vimshell.vim https://github.com/Shougo/vimshell.vim
- spraak 10y agoJust hit Esc then V and it drops you into a vi/m buffer, too
- gkya 10y agoThough if I'm not wrong you only get to edit current command line. The emacs shell buffer allows random editing, i.e. you can run regex search/replace on the output of a couple commands ago, then run it again through grep, or clean up your shell buffer and save it to a file.
- spraak 10y agoCame here to post that. Also Neovim :)
- qb45 10y ago> You can just type "set -o vi" in your shell I use the following instead, applies to bash and all other programs using readline. cat >>~/.inputrc <<EOF set editing-mode vi EOF
- pmoriarty 10y agoI don't think that will work in zsh, which doesn't use readline. But "set -o vi" will work in both bash and zsh (and possibly other shells as well, though I haven't checked). There's no harm in doing both, though -- and that's exactly what I do.