Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


> 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) that it's just 'v' in normal mode.


You can also bind "edit-and-execute-command" to another key in your ~/.inputrc .


This 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.


Alt+E in fish shell in case someone's running it in place of bash.


This is my new favorite bash trick. Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: