I'm aware of opening files in readonly mode from shell using vim -R
, but how to open a file from inside vim in a separate tab (:tabe <filename>
) in readonly mode?
Thanks for your time.
I'm aware of opening files in readonly mode from shell using vim -R
, but how to open a file from inside vim in a separate tab (:tabe <filename>
) in readonly mode?
Thanks for your time.
Try :tabedit +set\ noma|set\ ro FILE
; this will open FILE
in a new tab with modifiable
off and readonly
on, preventing you from modifying or writing the file. If you just want readonly
, omit the noma
set. Might be convenient to remap this to another command.