is "vi" worth learning in 2022?

Vi and Vim use curses. Its ed (or ex) that you would likely need to be using for your ancient 80x25 hardware terminal.
That's kind of the point. If you have curses, you don't need an editor with hidden states and 300 documented keyboard sequences to edit a line of text. I know better things to remember.
The idea of vi in UNIX systems is to provide an editor that works under as much as possible hardware combinations but that doesn't make it efficient for everything. Only when nothing else works.
 
MG your statement is both exaggeration while also pointing to the advantage of vi and why all professionals know and use it.
No doubt about it, but it's only an editor. I use it when there's nothing else. Last option because I prefer to see what I do immediately and the technical limitations that could make that a problem were common 40 years ago.
If I was stuck with a post '90s system with only vi, I would write an ncurses editor with the same keybindings as ee. 😆
 
I found it amusing when the Reddit Moderator Guy tried to put in a PR to change the FreeBSD shell default editor to easy-editor from vi.
Can / would you elaborate on this a little more? Because it seems you hit a nerve and now I'm very curious about this ;)

(edit)

To also stay a little bit ontopic here... I'm still using vi on almost a daily basis; and not just the editor. Because I enjoy the focus on keystrokes to "do" things I even enabled vi mode in my (KSH) shell. So if I press escape on the console then, yups: vi mode gets activated and I then use the "vi keys" to go through my history (or use / to do a quick search).

Pretty useful IMO.
 
The idea of vi in UNIX systems is to provide an editor that works under as much as possible hardware combinations but that doesn't make it efficient for everything. Only when nothing else works.
Each to their own, but I find vi quite efficient for the things it does. Not to mention that I think your comment is a little funny, because it makes me recall WordPerfect 5.1; that was also fully focused on keyboard shortcuts and sure enough, people said the same thing.

Thing is: just because you don't think something isn't efficient (which is a fair claim!) doesn't mean that this is actually true. I've used vi for... I think ever since '98 (or something close enough) when I got my certifications for Sun Solaris, and it's still my to-go-to editor whenever I'm on the command line (which is almost daily). Curses or not, I only use vi, and sometimes vim whenever I need to edit & compare 2 files; then having a dual pane is easy.

Point being: I can pretty much do anything I need or want. Looking up words, search/replace, going to a specific line, copy/cutting. And all those functions without having my hands ever leave the keyboard (to grab the mouse or try to access menus), which I find very efficient because it allows me to keep my focus and continue typing ;)

(edit)

No doubt about it, but it's only an editor.
You never lived the "vi vs. emacs" wars I guess? ;)
 
blackbird9 doesn't your vi or vim (both in my case) work with caps lock? I have found you have to turn it off if entering commands--for example if I do a movement command and caplocks is on, it does unexpected stuff.
There have been attempts to handle caps lock correctly in vim but none of them work very well. The problem is that if you switch to command mode with caps lock unintentionally on you have a problem, particularly on modern keyboards where for some really daft reason the manufacturers no longer provide a caps lock led on the keyboard. If you're a fast touch typist who doesn't look at the keyboard much, and you routinely use capslock, you're likely to have come a cropper on this one. It's a well known problem in vi/vim, there have been many attempts to fix it.


A quote from that last github link describes the problem succinctly:-

"Never be bothered by caps lock


As is known, capslock is almost useless in vim's normal mode.If it happens that the capslock is locked, you know what the fuckis going to happen:


  • You want to move up, but came out a man;
  • You wanna move down, but line joins;
  • You try to undo those joins, but it undo itself;
  • ...

So, lots of vimmers disabled the capslock or map it to another key.Yes, that is a beautiful solution. I don't like capslock too.But someday, I notice that the capslock is still useful,---if you have to use an on screen keyboard (e.g., with a touch screen)Then I decide to do a simple thing instead of remap the keyboard:Toggle off the capslock when back to normal mode,---that is what this plugin do."
 
[…]
Curses or not, I only use vi, and sometimes vim whenever I need to edit & compare 2 files; then having a dual pane is easy.
[…]

You can have two panes with FreeBSD's stock vi(1):
  1. Open the files vi file1.txt file2.txt
  2. Open second file in second pane: :N (note the captial-N!)
  3. Switch windows with CTRL-W
Very handy and no VIM needed!
 
That's kind of the point. If you have curses, you don't need an editor with hidden states and 300 documented keyboard sequences to edit a line of text. I know better things to remember.
The alternative is to learn ~4 different IDEs for different platforms and languages? No thanks.

Sure, Vi and Vim is outright weird for people having to learn it but that will carry on being the case into the future. Our great, great, great grandkids will also be complaining about it.

Vi has a vastly larger featureset than ee, nano and Microsoft notepad combined, so the latter aren't really comparable.

That said, this discussion about "Vi is awkward" has been done to death. I'm sure the many different arguments can be read from some mailing list archive somewhere.
 
Vi not dead! 😁
and for slackers...
1780221351611.png
1780221562355.png

1780223369933.png
1780223913158.png
 
You never lived the "vi vs. emacs" wars I guess? ;)
That's even worse. I had a Youtube discussion with someone who does everything in Emacs. I asked why everything should happen in 1 window but I still don't know.
The alternative is to learn ~4 different IDEs for different platforms and languages? No thanks.

Sure, Vi and Vim is outright weird for people having to learn it but that will carry on being the case into the future. Our great, great, great grandkids will also be complaining about it.

Vi has a vastly larger featureset than ee, nano and Microsoft notepad combined, so the latter aren't really comparable.

That said, this discussion about "Vi is awkward" has been done to death. I'm sure the many different arguments can be read from some mailing list archive somewhere.
It was known after reading the title, right? You are commenting to this old flame war yourself.
Also, something being my personal opinion of feeling doesn't invalidate anything. You already knew where we're at. Everything about is opinion.

You like to aim arrows but nobody cares because everybody knows this is a dead horse already. I can defend any alternative forever substantially, though. Everybody can.
Little irony about it is that people fighting for it for real have questionable computing skills. The text-editor you use really is a camp?
If you have a return/newline prompt input loop, that's almost a line editor. If you know how to listen to the keyboard directly, you can make an interactive editor...
 
Back
Top