I am editing a file using vim. I want to open another file (which currently exists) from within the same vim session and split my screen doing so. I want it to be read-only because I don't want to risk accidentally editing it.
If I try :sp another_file.txt
, it opens it in read/write mode.
How do I do this?
:view
command is what you are looking for. It opens buffer in readonly mode.
You can try :sv file.txt
to open file in split window.
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