Split vim window with one read / write file and one read-only file

I am editing a file using vim. I want to open another file (which currently exists) from one vim session and split my screen. 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 will open it in read / write mode.

How to do it?

+5
source share
1 answer

:view team is what you are looking for. It opens the buffer in readonly mode.

You can try :sv file.txt open the file in a split window.

+7
source

Source: https://habr.com/ru/post/1244427/


All Articles