@Flux @occhiolist@hachyderm.io
@irvingpop @spottyfox @socketwench - Actually, this would be a good time to ask. What are the resons for using Vi and Vim over Nano?
Originally, I only used Linux at my university and at an ISP I worked at for a short time. I used Vi in my university days but quickly moved over to Pico for ease of use.
I know when I worked at an ISP, they wanted me back on Vi, because Pico had a security flaw in it, which I did.
I've since moved permanently to Linux around ten years ago, and really haven't had anything that NEEDED Vi or Vim (outside of visudo when I was running Arch), so what's the major difference other than ease of use? I'm sure there are reasons to use it but because I don't write scripts or program, Nano is enough for me.
Not being adversarial, just genuinely curious. :)
@hjvt @Flux @occhiolist@hachyderm.io @irvingpop @spottyfox @socketwench - that makes sense. I don't do any coding myself, so I've never needed it. Thanks for clearing that up for me!
@hjvt @dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench In other words; nano is for when you want to easily save a file and exit, and vim is for when you don't want to easily save a file and exit?
@dolari @occhiolist @irvingpop @spottyfox @socketwench It's the difference between MS Paint and Photoshop.
When you write code you spend all your time in the editor and need to ask it complex questions like "Where are all the bits of text that look like function declarations that have 'foo' in them"? Vim is good at letting you interact in these kinds of ways.
Programmers, of course, have all sorts of different preferendces in how to work, and editor preference influences a lot of the process.
@Flux @occhiolist@hachyderm.io @irvingpop @spottyfox @socketwench - as a cartoonist, this comparison makes perfect sense. Thank you. :)
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench What wholesome moment did I just witness.
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench isn't nano the one with ctl+x and other ctl+ shortcuts? I only like to hit ctl when panicking in the terminal. Using / or ? Search is also great and easy to use.
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench one thing not mentioned: vi is in more places than nano. So it's at least worth knowing how to use the basics, if you're working on Linux (or solaris)
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench
I'd say similar reasons as for using Emacs¹: having a very powerful tool to work _on_ text in all kinds of ways (not only type it and occasionally delete something).
You have rich commands to manipulate text and you can add libs or create your own. While vi(m)/neovim follows the “switch between insert and command mode” paradigm Emacs is more “everything is a command”.
Steep learning curve → power.
__
¹I am an Emacs user.
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench Lots of good answers here. I’ll add that, yes it’s a lot of work to learn, but I made that effort in 1983. Through 40 years, it’s always been there for me.
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench I was taught vi so that’s what I use. Nano is fine though. Emacs…ewwwww
@brachinus @dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench
I would probably be an Emacs user if it was standardized in 1980, but every Emacs and Emacs clone (because you couldn't run a real Emacs on a PDP-11) had a different and quirky key-mapping that changed every few months and I couldn't be arsed keeping track.
@resuna @dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench I kinda learned emacs but I liked vi better so that’s what I stuck with
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench
I can't do ":g/^[^ ^I].*{$/s/size_t/off_t/g" in pico or nano.
Edit: But don't forget, "Ed is the standard text editor".
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench nano is newfangled stuff (1999!) and emulates pico (😩). Also it's GPL. And vi is POSIX.
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench
vim has a lot of subtle conveniences for text editing. the one i miss the most in other applications is the . command, which repeats the last edit, so one can search for something, edit, then n to next occurrence, . to make the same edit if appropriate or go to next
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench
modal editing
@dolari @irvingpop I don't know if this is still true, but one advantage of the VI-family of editors is that they were installed pretty much on every Unix-like operating system, where pico/nano were not. This was important after just installing a fresh version of a proprietary Unix OS on Sun, SGI, or other hardware.
Given the death of proprietary Unixes, I don't know if this still a large enough competitive advantage, but the muscle memory from three decades is still there for me.
@chris @irvingpop - This actually was a thing I ran into when I would install Arch on my systems. Nano had to be downloaded, while VI was just there.
@dolari @Flux @occhiolist @irvingpop @spottyfox @socketwench nano is for when you need to change a single line in a config. Vim is a fully featured code editor.
People aren't using vim as a nano alternative, but as a vs code alternative.