You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pynvim implements support for python plugins in Nvim. It also works as a library for
@@ -11,40 +10,30 @@ connecting to and scripting Nvim processes through its msgpack-rpc API.
11
10
Install
12
11
-------
13
12
14
-
Supports python 2.7, and 3.4 or later.
13
+
Supports python 3.7 or later.
15
14
16
-
```sh
17
-
pip2 install pynvim
18
-
pip3 install pynvim
19
-
```
20
-
21
-
If you only use one of python2 or python3, it is enough to install that
22
-
version. You can install the package without being root by adding the `--user`
23
-
flag.
15
+
pip3 install pynvim
24
16
17
+
You can install the package without being root by adding the `--user` flag.
25
18
Anytime you upgrade Neovim, make sure to upgrade pynvim as well:
26
-
```sh
27
-
pip2 install --upgrade pynvim
28
-
pip3 install --upgrade pynvim
29
-
```
30
19
31
-
Alternatively, the master version could be installed by executing the following
32
-
in the root of this repository:
33
-
```sh
34
-
pip2 install .
35
-
pip3 install .
36
-
```
20
+
pip3 install --upgrade pynvim
21
+
22
+
Alternatively, you can install the development version by cloning this
23
+
repository and executing the following at the top level:
24
+
25
+
pip3 install .
37
26
38
27
Python Plugin API
39
28
-----------------
40
29
41
30
Pynvim supports python _remote plugins_ (via the language-agnostic Nvim rplugin
42
-
interface), as well as _Vim plugins_ (via the `:python[3]` interface). Thus when
43
-
pynvim is installed Neovim will report support for the `+python[3]` Vim feature.
31
+
interface), as well as _Vim plugins_ (via the `:python3` interface). Thus when
32
+
pynvim is installed Neovim will report support for the `+python3` Vim feature.
44
33
45
34
The rplugin interface allows plugins to handle vimL function calls as well as
46
35
defining commands and autocommands, and such plugins can operate asynchronously
47
-
without blocking nvim. For details on the new rplugin interface,
36
+
without blocking nvim. For details on the new rplugin interface,
48
37
see the [Remote Plugin](http://pynvim.readthedocs.io/en/latest/usage/remote-plugins.html) documentation.
49
38
50
39
Pynvim defines some extensions over the vim python API:
@@ -56,13 +45,16 @@ Pynvim defines some extensions over the vim python API:
56
45
57
46
See the [Python Plugin API](http://pynvim.readthedocs.io/en/latest/usage/python-plugin-api.html) documentation for usage of this new functionality.
58
47
48
+
### Known Issues
49
+
- Vim evaluates `'v:<bool>'` to `<class 'bool'>`, whereas neovim evaluates to `<class 'str'>`. This is expected behaviour due to the way booleans are implemented in python as explained [here](https://github.com/neovim/pynvim/issues/523#issuecomment-1495502011).
50
+
59
51
Development
60
52
-----------
61
53
62
-
Use (and activate) a local virtualenv.
54
+
Use (and activate) a local virtualenv, for example:
63
55
64
-
python3 -m venv env36
65
-
source env36/bin/activate
56
+
python3 -m virtualenv venv
57
+
source venv/bin/activate
66
58
67
59
If you change the code, you must reinstall for the changes to take effect:
68
60
@@ -80,22 +72,23 @@ documentation.
80
72
### Usage from the Python REPL
81
73
82
74
A number of different transports are supported, but the simplest way to get
83
-
started is with the python REPL. First, start Nvim with a known address (or use
84
-
the `$NVIM_LISTEN_ADDRESS` of a running instance):
75
+
started is with the python REPL. First, start Nvim with a known address:
85
76
86
77
```sh
87
-
$ NVIM_LISTEN_ADDRESS=/tmp/nvim nvim
78
+
$ nvim --listen /tmp/nvim.sock
88
79
```
89
80
81
+
Or alternatively, note the `v:servername` address of a running Nvim instance.
82
+
90
83
In another terminal, connect a python REPL to Nvim (note that the API is similar
0 commit comments