4 ms·
I consider this misinformation and makes my blood boil. I feel like the author learn partial information and decided to write a blog about without researching f
by dorfsmay 10y ago
I consider this misinformation and makes my blood boil. I feel like the author learn partial information and decided to write a blog about without researching further...
ctrl-R is not bash, it's GNU readline.
http://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html http://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html
If you are going to use command line, than absolutely you should use command history editing, but why limiting yourself to a few commands learned through osmosis or haphazardly rather than use a full editor? Why use C-r to search backwards, but not M-backspace to delete an entire word?
When I explain this, people usually argue that "there are two many weird commands to learn, and I only need the few I know". The same type of people often go on a rant about how much vim is so much better than emacs.
There are not weird command to learn, none, zero!
Use your preferred editor! You already know it, you already know all those commands, and if you don't buy a book and learn them! You know and like emacs? Great, that's the default in readline. Go ahead C-r, C-backspace, C-a, C-e, M-f all you need. You already know all of those.
But you don't like emacs, or don't even know that it exists beside the fact that it's something fun to shit on? You think you're a big shot because you know vim really well? Not an issue, type the magic command "set -o vi" and you are now in vi mode, you can esc-/ to search, esc-k to call the last command, and once editing a command, cw to change word, $ to go to the end of the line, etc...
I do not buy "I'm a vim person, but I just use ctrl-R and the arrows", because you are basically limiting yourself just because you had not realised readline is a full editor. You have nothing to learn, just set the editor mode in your preferred editor mode, and start using it, trust me, you will start getting use to it and use its power very quickly.
BONUS: It' snot just bash! Any program that use readline can do the same! psql etc... use it (or a something like readline, because of GPL vs non-gpl etc...).
BONUS 2: You can use readline with software that don't use it, it's call rlwrap. Go ahead, use "rlwrap sqlplus" once, then try to use oracle without it!
- deleted 10y ago[deleted]
- dllthomas 10y ago> ctrl-R is not bash, it's GNU readline As readline was codeveloped with bash, I think it's incorrect to say it's not bash. It is bash by way of readline - additional information important for some contexts, not for others. > cw to change word, $ to go to the end of the line, etc... But not, sadly, ci" to change what's inside quotes. ---- As to your obviously troubling experiences with some vim users, I apologize on behalf of my sect. But tone down your characterizations - there are plenty of smug and superior emacs users as well. (For my part, I don't much care what others use as long as they actually learn their way around some sort of powerful editor.)
- dorfsmay 10y agoI'm a vim person myself. my issue isn't with vim vs emacs, but that people who choose vim as their editor don't switch their command line editing to vim mode, and find it both worse and ironic when it comes to the subset of vim users who are vocal against emacs!
- dllthomas 10y agoI think there's a fair amount of room for a workflow that does most meaningful commandline manipulation inside the editor, in which case leaving vim in emacs mode and "just" knowing C-r and C-x C-e could be sort of reasonable. I certainly understand being skeptical of "vim modes" - they are often incomplete in painful ways. As mentioned above, I often run up against the limitations of bash vim mode when trying to change what's inside quotes.
- lolive 10y agoYour remark is valid. But admit that this post created the discussion. And led to interesting information sharing. So I +1 your comment. And I +1 the article too.
- MyNameIsFred 10y agoI'm the kind of person you're ranting about here, but...thank you.
- clebio 10y ago+1 just for rlwrap.