Hacker News new | past | comments | ask | show | jobs | submit login

In what circumstances would you run `vi` and find yourself upset that you end up in `vim`?



You won’t, but vi is scriptable and part of POSIX.

It’s a basic infrastructure that you don’t want to break.


Apparently the original vi isn't POSIX compliant; nor is vim. https://vimhelp.org/vi_diff.txt.html#posix

I think "if the script worked before, I want it to work later" has much more practical weight. Though, on the other side of practicality, I've heard sed, awk, and perl suggested for manipulating text in bash scripts far more than I've heard of vi recommended for the task.


Yes. If you need to do some text manipulation in a shell script, `sed` or something like that is what I'd reach for first. (I haven't used `awk` or Perl for quite a while.) I'd think even `ed` would be a more straightforward choice than `vi`.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: