sponsor Vim development Vim logo Vim Book Ad

vim-readonly : Automatically set readonly option on specific files.

 script karma  Rating 0/0, Downloaded by 526  Comments, bugs, improvements  Vim wiki

created by
Y. Choi
 
script type
utility
 
description
# readonly.vim
[![Script manager: vishop](https://img.shields.io/badge/script%20manager-vishop-blueviolet)](https://github.com/Xvezda/vishop)

Automatically
set readonly option on specific files.

This plugin is useful when if you are person like me,
who likes to look around internal or package manager managed (i.e. pip, npm, etc.)
source codes with vim.

It protects original source code from modifying accidentally by user.


## Installation

Using vim-plug:
```vim
Plug 'Xvezda/vim-readonly'
```

or

```sh
make install
```

## Usage

`g:readonly_automatic` is enabled by default.

Use `:Readonly` to manually enable readonly option, and `:Readonly!` to disable.


## Global options

| Flag                          | Description                                                               | Default                                                       |
| ----------------------        | --------------------------------------------------                        | -------                                                       |
| `g:readonly_automatic`        | Automatically set readonly when patterns are match                        | `1`                                                           |
| `g:readonly_paths`            | Set patterns of path to set readonly option                               | `['/usr/bin/lib/', '/usr/local/lib/', '/usr/local/include/']` |
| `g:readonly_nodejs`           | Add NodeJs package path to readonly paths                                 | `1`                                                           |
| `g:readonly_python`           | Add python package path to readonly paths                                 | `1`                                                           |
| `g:readonly_check_virtualenv` | Add python virtualenv path to readonly paths when virtualenv is activated | `1`                                                           |


## Homepage

https://github.com/Xvezda/vim-readonly

>## Copyright

Copyright (C) 2020 Xvezda

MIT License
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-readonly-1.3.tar.gz 1.3 2020-12-20 7.0 Y. Choi + Add vim runtime path
vim-readonly-1.2.tar.gz 1.2 2020-09-19 7.0 Y. Choi + Fix performance issue (startup time)
vim-readonly-1.1.tar.gz 1.1 2020-07-05 7.0 Y. Choi + Fix python develop mode issue
vim-readonly-1.0.tar.gz 1.0 2020-07-04 7.0 Y. Choi Initial upload
ip used for rating: 3.12.36.30

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github