4 ms·
You can also hit Ctrl-x Ctrl-e to edit the command line in your preferred text editor, and run it when saved and closed in the editor. So you can type the mv, t
by JoshTriplett 7y ago
You can also hit Ctrl-x Ctrl-e to edit the command line in your preferred text editor, and run it when saved and closed in the editor. So you can type the mv, tab-complete the current filename, and use the editor for the new filename.
- stilley2 7y agoThis is my new favorite bash trick. Thanks!
- JadeNB 7y ago> You can also hit Ctrl-x Ctrl-e to edit the command line in your preferred text editor, and run it when saved and closed in the editor. So you can type the mv, tab-complete the current filename, and use the editor for the new filename. This doesn't seem to work in readline's vi mode. Do you know the equivalent there? EDIT: Ah, kesor points out elsewhere (https://news.ycombinator.com/item?id=22861894 https://news.ycombinator.com/item?id=22861894) that it's just 'v' in normal mode.
- JoshTriplett 7y agoYou can also bind "edit-and-execute-command" to another key in your ~/.inputrc .
- Hamuko 7y agoAlt+E in fish shell in case someone's running it in place of bash.
- chronolitus 7y agoThis might be the compromise which unites all camps: - it only uses standard tools and keymaps, which pleases the bash greybeards. - it uses your favorite-editor expertise instead of relying on situation-specific new/rare commands (Ctrl-W Ctrl-something what was it again?), which pleases the limited-braincache crowd. - like the OP solution, it is interactive. you start typing mv something/yourfile, then realize things are going to get complicated: no need to backtrack, look up the manual for brace expansion, etc, just Ctrl-x Ctrl-e, do your thing. this pleases the intuitive UX crowd.