1
- *if_pyth.txt* For Vim version 8.0 . Last change: 2017 Mar 09
1
+ *if_pyth.txt* For Vim version 8.1 . Last change: 2018 Jan 30
2
2
3
3
4
4
VIM REFERENCE MANUAL by Paul Moore
@@ -715,6 +715,8 @@ To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
715
715
functions to evaluate Python expressions and pass their values to Vim script.
716
716
| pyxeval() | is also available.
717
717
718
+ The Python value "None" is converted to v:none.
719
+
718
720
==============================================================================
719
721
9. Dynamic loading *python-dynamic*
720
722
@@ -734,8 +736,8 @@ or 'pythonthreedll' option can be also used to specify the Python DLL.
734
736
735
737
The name of the DLL should match the Python version Vim was compiled with.
736
738
Currently the name for Python 2 is "python27.dll", that is for Python 2.7.
737
- That is the default value for 'pythondll' . For Python 3 it is python35 .dll
738
- (Python 3.5 ). To know for sure edit "gvim.exe" and search for
739
+ That is the default value for 'pythondll' . For Python 3 it is python36 .dll
740
+ (Python 3.6 ). To know for sure edit "gvim.exe" and search for
739
741
"python\d*.dll\c".
740
742
741
743
@@ -807,7 +809,8 @@ Raising SystemExit exception in python isn't endorsed way to quit vim, use: >
807
809
You can test what Python version is available with: >
808
810
if has('python')
809
811
echo 'there is Python 2.x'
810
- elseif has('python3')
812
+ endif
813
+ if has('python3')
811
814
echo 'there is Python 3.x'
812
815
endif
813
816
@@ -816,6 +819,24 @@ dynamically, these has() calls will try to load them. If only one can be
816
819
loaded at a time, just checking if Python 2 or 3 are available will prevent
817
820
the other one from being available.
818
821
822
+ To avoid loading the dynamic library, only check if Vim was compiled with
823
+ python support: >
824
+ if has('python_compiled')
825
+ echo 'compiled with Python 2.x support'
826
+ if has('python_dynamic')
827
+ echo 'Python 2.x dynamically loaded'
828
+ endif
829
+ endif
830
+ if has('python3_compiled')
831
+ echo 'compiled with Python 3.x support'
832
+ if has('python3_dynamic')
833
+ echo 'Python 3.x dynamically loaded'
834
+ endif
835
+ endif
836
+
837
+ This also tells you whether Python is dynamically loaded, which will fail if
838
+ the runtime library cannot be found.
839
+
819
840
==============================================================================
820
841
11. Python X *python_x* *pythonx*
821
842
@@ -894,10 +915,10 @@ On Ubuntu you will want to install these packages for Python 2:
894
915
python-dev
895
916
For Python 3:
896
917
python3
897
- pytyon3 -dev
918
+ python3 -dev
898
919
For Python 3.6:
899
920
python3.6
900
- pytyon3 .6-dev
921
+ python3 .6-dev
901
922
902
923
If you have more than one version of Python 3, you need to link python3 to the
903
924
one you prefer, before running configure.
0 commit comments