[WIP] Preliminary empty draft about the python interface#66
Open
bstaletic wants to merge 1 commit into
Open
Conversation
The plan is do go in details about the python interface. This would include: - The basic inline python and calling python functions from the vim command line. - Checking that vim has been compiled with python support and correctly\* invoking python from inside vim. - Becoming friends with `import vim` - an in depth showcase of what vim exposes through this embedded python module and how to work around limitations when encountered. - Approach to writing an abstraction over the "raw" `vim` module, because conversions from a vim type to a python type can have surprising results. - There should be a special part about handling unicode, because python2/python3 differences here make passing a vim `'šт®ïñг'` to python an easy foot-gun.
Contributor
|
Looks interesting. I don't know too much about the Python interface, so
I look forward to reading the final result!
One suggestion, that I didn't see in your outline ... it's been my
experience using Python plugins that others have written is that they
tend to be fairly slow compared to pure Vimscript. Were you planning to
discuss how to avoid that situation?
|
Contributor
|
@bstaletic Is it safe to assume that you won't be able to finish this article? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The plan is do go in details about the python interface. This would
include:
command line.
correctly* invoking python from inside vim.
import vim- an in depth showcase of what vimexposes through this embedded python module and how to work around
limitations when encountered.
vimmodule,because conversions from a vim type to a python type can have surprising
results.
python2/python3 differences here make passing a vim
'šт®ïñг'to pythonan easy foot-gun.
* Maybe also mention that no matter what, some non-working python enabled vim installations exist? For example, the default vim on the latest macOS has broken python support, causing python to raise
MemoryErrorat best and make vim segfault at worst.NOTE: As you can see, this is an empty PR. I'll be able to work on this after the 15th of July, but @romainl asked me to post an empty PR anyway. For reference, the discussion is here.