4 ms·
"Shame, then, that even serious command line hackers never bother learning about its capabilities, as they can supercharge your command line productivity." Bec
by stuaxo 4y ago
"Shame, then, that even serious command line hackers never bother learning about its capabilities, as they can supercharge your command line productivity."
Because it is really confusing if you are not an emacs user.
- motoboi 4y agoNot at all. bash readline is probably the productivity enhancer skill a developer (or system admin) can develop. Simple things like copy and paste without hitting a mouse. This will make you _prefer_ the cli as it is not slowing you down anymore.
- Too 4y agoYes please. Teach me how to copy output of previous command into clipboard using keyboard only and I will love you forever. Bonus if I can have a cursor to only select partial lines of the output.
- manx 4y agoMany terminals have a different mode, where you can navigate and copy everything displayed in the terminal. Alacritty can do this, for example.
- znpy 4y agoUnrelated, but you could easily do that on screen with C-a ESC (default key binding)
- jbaber 4y agoYou can pipe to xclip to get it into the copy buffer. Then "shift-insert" is often the right paste when "ctrl-v" doesn't work.
- Too 4y agoThanks for tip, but quite far from ideal. Piping into something requires 1. knowing upfront I want to copy the output. 2. Doesn’t allow partial selection of the output. 3. Extra typing | xclip after every command. 4. Xclip is not installed by default.
- freedomben 4y agoI'm a vim guy, and I don't find the readline commands confusing. I just think of it as "Insert" mode in Vim (many of the readline commands work there too!!) and it feels pretty natural.
- deleted 4y ago[deleted]
- jcul 4y agoHave you tried vi mode in bash? "set -o vi" I think. Then you can use vi(m) commands, modal editing, even press v to drop into a full vim instance for doing more advanced editing of a command line. It's amazing.
- sagarm 4y agoI am a VI user but prefer to use emacs keybindings in bash. If I need to do significant editing, VIM is just a C-x C-e away.
- weaksauce 4y agoThe thing that bugs me about that mode is that you have no indication of what mode you are in and that is jarring just enough times that it was worse than just using the few emacs keybinds that I could remember. (ctrl-a,e,k basically) (n.b.: i didn't try to configure this that hard so unless they fixed this in zsh or some configuration thing and that would be great)
- gkfasdfasdf 4y agoTIL `set -o vi` is a shortcut for setting `set editing-mode vi` in .inputrc for bash only - except it seems like the .inputrc version would apply to anything that uses readline (gdb, etc) https://unix.stackexchange.com/questions/485818/bashs-set-o-vi-vs-readlines-own-options https://unix.stackexchange.com/questions/485818/bashs-set-o-...
- deleted 4y ago[deleted]
- gumby 4y ago> Because it is really confusing if you are not an emacs user. Or a make user -- the text input widgets on macOS natively interpret ^a, ^f, and other basic Emacs commands, and have since the NeXT days.
- jolmg 4y agoAdd `set editing-mode vi` to your ~/.inputrc and readline's keybindings resemble vi instead of emacs. You can also define your own keybidings as you like, like `Meta-Control-h: backward-kill-word` as seen in the example file in `info readline -n 'Sample Init File'`. Works with bash and whatever else that's using readline, like the python console, postgresql client, etc.