nvie / vim_bridge Goto Github PK
View Code? Open in Web Editor NEWA Python-to-Vim bridge decorator that allows transparent calls to Python functions in native Vim scripts.
A Python-to-Vim bridge decorator that allows transparent calls to Python functions in native Vim scripts.
For example:
@bridged(private=True)
def Foo(name):
return name
Which would declare Foo as s:Foo (getting the Vim prefix). In Python code, this function should still remain callable as Foo().
Vim requires functions to start with a capital letter. In Python, however, function names follow snake case convention. We should support the following, ideally:
python << eop
@bridged
def some_nice_function():
return ...
eop
echo SomeNiceFunction()
Maybe this can be deduced from the meta info on fin
, but otherwise, we should add a parameter to the @bridged
decorator, like so:
@bridged(no_return=True)
def Foo(): pass
Like this. Inside a Python block:
@bridged
def say_hello(name="World"):
return "Hello, %s!" % name
Which should be callable in Vim with:
echo SayHello()
echo SayHello("Vincent")
So a "del _vim_bridge*" doesn't delete variables for other windows.
Currently, when a Python function returns a bool, this evaluates to a "return True" vim command, which results in an error stating "Undefined variable True". Explicitly convert this to 0/1 in the wrapper.
Hi, Can you release 0.6 please as master works with Python 3.5+, but version 0.5 doesn't.
Thanks.
Link to the port: https://www.freshports.org/editors/py-vim-bridge
I only had to patch some Python 3-related bit in the test suite (freebsd/freebsd-ports@8e0a4fc#diff-51ad548fc64b4b8e21c92500ec56b5c70a45b8e4d0b9a66f4a522ec854d99231). Otherwise, it just works!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.