vim-node icon indicating copy to clipboard operation
vim-node copied to clipboard

Make opened modules read-only by default

Open nfischer opened this issue 10 years ago • 2 comments

To me, it makes a lot of sense to make some modules open in read-only when opened by gf or :Nedit and the like. It doesn't make much sense to be able to edit the fs module, which is a standard module.

On the other hand, it makes more sense to be allowed to edit locally downloaded modules. The distinction of course can be easily made, since standard modules such as fs must be curled, while local modules are found locally. So the same logic could be used to set readonly and set nomodifiable.

nfischer avatar Jan 12 '16 23:01 nfischer

This is resolved by #31.

Core modules are opened in readonly mode, and local files are opened with standard permissions.

A possible extension to this would be to open dependencies (things inside node_modules/ and the equivalent for global packages) in readonly as well.

nfischer avatar Jan 12 '16 23:01 nfischer

Surprising that Netrw itself doesn't set them readonly... I can understand not doing so for protocols that have a standard for uploading files, but for HTTP...

moll avatar Jan 12 '16 23:01 moll