Open file vim read only




















Olivier Faucheux Olivier Faucheux 2, 3 3 gold badges 27 27 silver badges 34 34 bronze badges. Can be done using view. Any way to turn this on? That works. Any way to turn this on by default? I have syntax on setting in. Does not work for me. Or some other setting is interfering. Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. For further ref here. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. Asked 11 years, 2 months ago. Active 3 years, 10 months ago. Viewed 73k times. Improve this question. Nifle Nifle Note: if you don't have the write permission to the file, Vim will by default open it in read-only mode. Actually, I think it is easier to control the file permission than to provide a "read-only" way.

Add a comment. Active Oldest Votes. For emacs: emacs FILE --eval ' setq buffer-read-only t ' There's no startup option to force read only. Improve this answer. Nifle Trey Jackson Trey Jackson 3, 21 21 silver badges 25 25 bronze badges. Asked 11 years, 4 months ago. Active 6 years, 5 months ago. Viewed 28k times. I just want to know how to turn off readonly mode on this file, before or after I open it. Improve this question. Tom McJones. What type of file is it? Where is it located?

Some file locations in the user directory will open in read-only, and w! Add a comment. Active Oldest Votes. Improve this answer. Nentuaby Nentuaby 4 4 silver badges 8 8 bronze badges. Actually, it can be a permission issue. Simply force the file to be written-to by using :w!. You should be golden. One of the disadvantages is you are prone to accidentally alter file content and end up saving it in the file. This is a threat to file integrity and hence needs to be avoided.

The option is to view files in vi editors carefully or open them in read-only mode! One of the widely used ways to view files in vi editors. Simple open file with view command. You can see above it shows readonly at the bottom and open file in vi editors.



0コメント

  • 1000 / 1000