I have searched through couple of places but wasn't able to find any answer. The title states it all, is there a command to close the current file and re-open it right away in read-only mode?
say your file is hello.sh which you opened in vim with
vim hello.sh
now to close and open it in read-only, press ESC and type
:view!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With