17 ms·
So instead of just retyping the command (much less than 1s), I have to remember to open the editor, and then think of how to edit it, and then execute those ste
by userbinator 2mo ago
So instead of just retyping the command (much less than 1s), I have to remember to open the editor, and then think of how to edit it, and then execute those steps? Hell no. At that point I'll have long lost my original train of thought. The original command, and at least the subsequent one, are already in my mind and can be output immediately. Any deviations from that plan are going to be much slower.
ctrl-x ctrl-e
Just thinking about that almost makes my fingers hurt. A chorded sequence of two keys, same side of the keyboard, nearly in a vertical line on the top and bottom row, is basically the slowest and most awkward possible combination to type.
- db48x 2mo agoOnly because you’re typing it incorrectly. Use both hands. One presses the modifier, the other types the letter. That's why you have modifiers on both sides! C-x means to use your right hand to hold down control, while using your left to type the x.
- userbinator 2mo agoX E is still a terribly slow sequence to type.
- db48x 2mo agoNot that slow; maybe you just need practice. Alternatively just bind it to whatever key you prefer by editing your `~/.inputrc`. Add a line like this to it: "\C-e": edit-and-execute-command and you will only have to type control-e to edit the current command. Don’t forget that `bind -P` will list all the current key bindings. It’s rarer, but you might also have some keys bound not to internal commands but to strings or external commands. You can list those with `bind -S` and `bind -X` respectively. Also, don’t forget that lots of other things use readline too. You can use the same key bindings in many interactive environments, such as your favorite programming language’s REPL, your SQL prompt, calculators like bc or units, your favorite debugger, etc. If you come across a command environment that doesn’t use readline directly you can run it with rlwrap to remedy that. The more you use them the more places you will find where they are useful, and the more utility you will get out of them.