What the hell use it is I have zero idea !
vim-tiny is the bare minimal install of vim, with very few extensions compiled in.
vi is provided by running vim in "compatible" mode, which disables any vim extensions (there aren’t many in Vim-tiny) and makes it behave exactly like classic vi.
As
@sphen pointed out - it allows config files to be edited in the terminal. This is especially useful in environments where there may be no GUI available.
For example, if you’re SSH’d into a remote server which is running in headless mode. Or if your desktop crashes after making some changes to its configuration, or you’ve changed/updated your graphics card drivers and the screen goes blank.
In cases where the desktop has crashed, or the graphics card refuses to play ball, you can typically still open a terminal via ctrl+alt+Fx (any function key from F1-F6). And in order to fix what you did, you will need to use a terminal based editor, because the GUI is unavailable.
For many years vi (via vim-tiny) was the default terminal based editor for ALL Linux distros. Vi and vim may not be quite as popular as they were. Many distros now set nano as the default terminal editor, rather than vi.bProbably because nano is a bit more intuitive/user-friendly for ordinary users, who’ve never heard of vi/vim, let alone used it. But typically, vim-tiny is still pre-installed for those of us who prefer vi/vim. And there are still quite a lot of us!! Ha ha!
Also sudo requires visudo for editing its configuration. So again, on systems that use sudo, vim-tiny is required to provide the editor for visudo.
Though visudo can be ran with other editors:
You could substitute nano in the above line, with any other terminal based editor (emacs, joe etc).
But looking at the above and thinking about it - the $EDITOR environment variable is a user-level, global environment variable that defines the default editor for the terminal.
So on systems where nano has already been made the default terminal emulator, perhaps visudo works with nano out of the box, without needing to specify it as per the above?! IDK. I’ve never tried it!
As soon as nano started to become the default terminal editor, I explicitly changed the $EDITOR environment variable back to vim in my .bash_profile config.
Anyway, the visudo invocation I shared above temporarily overrides $EDITOR, to make visudo use whatever editor is specified.
So, regardless of which terminal based editor is default, if you want to specify a different editor just for visudo, that’s how you’d do it.
Like I say, I’ve always installed and used full-fat vim as my default terminal editor. So I don’t know what visudo does by default, if nano is already set as the default editor. Does it use nano out of the box? Or does it still require the invocation I shared?! IDK!!
I’ll leave you guys to find that out, ha ha!