0

Followup-up on Advantages of using set -o vi

I'm learning vi and know nothing about emacs. I also type poorly and frequently need to edit my commands in the terminal. The idea of using vi to edit my poorly typed commands sounds like a good idea. At present when editing, I use arrow keys to get to the place I want to change. I'm thinking of using: set -o vi . However, there was an admonishment in the article (somewhat down the page by mattb): I set up my vim to immediately add a # at the start of the line when I do Esc-v to protect myself from this possibility. So, my question? How do I do as suggested by mattb?

Thank you for any reply. larry

If I placed this question in the wrong place, I apologize!!

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501
LarryS
  • 1
  • What article are you talking about? … … … … … … … … … … … … … … … … … … Please do not respond in comments; [edit] your question to make it clearer and more complete. – G-Man Says 'Reinstate Monica' Mar 13 '22 at 16:52
  • That `v` in command mode to launch `vi` is a ksh/bash thing. In `zsh`, `v` enters visual mode like in `vim`. There is however a `edit-command-line` custom widget that you could bind to some key to get a similar behaviour as in ksh. – Stéphane Chazelas Mar 13 '22 at 18:45
  • Thank you! I am new at all of this (terminal usage and programming in general); truthfully, a reentry to this. I had used bash but Apple decided (a while ago) to switch to zsh. I keep reading that bash and zsh are very similar. From your comment, it appears that I can't use `set -o v` . Is that correct? That would make my original question mute. I guess I'll keep using arrow keys to locate and edit my poorly typed commands. – LarryS Mar 13 '22 at 19:30
  • Apple decided to switch the default shell for new users to be `zsh`. If you want or need to use `bash`, by all means use `bash`. The only person to whom the shell you use matters is yourself. – Marc Wilson Mar 13 '22 at 21:24
  • I have one important server where, over 10 years go, I switched the shell to `set -o vi` mode. Though I'm a Vim user, every time I go into that shell, I don't like it. I don't bother reverting it though. – Kaz Jun 08 '23 at 03:30

0 Answers0