Open a file in a tab in vim in readonly mode

后端 未结 7 1402
刺人心
刺人心 2021-01-30 12:25

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 )

7条回答
  •  一生所求
    2021-01-30 12:55

    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.

提交回复
热议问题