Why can we manipulate a read-only file in Vim using : + w + q + ! even without being an administrator?
I have a text file (myFile.txt) which is read-only for everyone:
navid@navid-ThinkPad-T530:~/ubuntuTest$ ls -l myFile.txt -r--r--r-- 1 navid navid 26 Aug 22 21:21 myFile.txt
I can open it with Vim without having admin privileges:
navid@navid-ThinkPad-T530:~/ubuntuTest$ vi myFile.txt
I modify it and press: Esc + : + w + q + Enter and I see this error message:
E45: 'readonly' option is set (add ! to override)
So far, everything makes sense. But when I press: Esc + : + w + q + ! + Enter, Vim saves the changes.
I'm using Ubuntu 16.04 and VIM 7.4.