$ touch myfile.txt
$ vim myfile.txt
$ touch myfile.txt
$ vim myfile.txt
You are correct.
And for me anyway, this is a benefit. When I used windows (and the same holds for google docs) I always had "New Folder"s everywhere that I'd created for whatever reason and then changed my mind or got distracted. Same with new documents. In vim, I do like to say, and it I change my mind and don't save it, I never see it again. If I touch'd it first, inevitably I'd have empty files everywhere.
With a touch first, saving the file always works.
1: https://www.cyberciti.biz/faq/vim-vi-text-editor-save-file-w...
Sadly it does not save me from going and editing a system file as non-root and then trying to save... :(
I wonder why this feels so natural in the terminal but so annoying in GUIs. I cannot remember any specific examples, but I think there are some GUI applications that require you to select a location before you start editing a new document (maybe some audio workstations?). I remember feeling annoyed by that.
Then again, the difference between "document-centric" and "application-centric" doesn't make a lot of sense in the context of the command line because 90% of files you work with are text files anyway. There is much less coupling between document types and applications than in the GUI world.
If we're playing golf, this works (overwriting if the file exists):
>myfile.txtThe variant I know that works identically in pretty much every shell I've ever tried is:
:>myfile.txt
And if you don't want to overwrite the file if it exists: :>>myfile.txt