conjure-client-python-stdio.txt

Branches > main > d3c0a10 > files / nvim / pack / plugins / opt / conjure / doc / conjure-client-python-stdio.txt

                                                   *conjure-client-python-stdio*==============================================================================CONTENTS                                  *conjure-client-python-stdio-contents*    1. Introduction ........ |conjure-client-python-stdio-introduction|    2. Mappings ................ |conjure-client-python-stdio-mappings|    3. Configuration ...... |conjure-client-python-stdio-configuration|==============================================================================INTRODUCTION                          *conjure-client-python-stdio-introduction*>  Python is a programming language that lets you work more quickly and  integrate your systems more effectively.Conjure starts a Python REPL within Neovim when you first open a Python file.We set `__name__` to `__repl__` which means you can alter your program entrypoint to include `__repl__` if you wish to execute your software from the REPLas well as the command line.>python if __name__ in ("__main__", "__repl__"):Conjure also sets `__file__` to the path of the buffer being evaluated beforeeach evaluation. Multi-line evaluations use that path as the filename passed toPython's `compile`, so tracebacks should point back at the evaluated buffer.Once you have tree sitter installed and configured (remember to run`:TSInstall python`!) you should be able to evaluate forms just like you wouldin any other Conjure supported language.By default, Conjure uses `python3` to create a REPL, which can be best managedusing Python virtual environments. Look for how to "activate" a virtualenvironment using your Python build tool of choice. For example, running`eval $(poetry env activate)` before opening Neovim makes `python3` equivalentto `poetry run python3`, enabling Conjure to seamlessly integrate with yourPoetry project.Check out `:ConjureSchool` if you're unsure about what evaluation operationsyou can perform. * https://www.python.org/==============================================================================MAPPINGS                                  *conjure-client-python-stdio-mappings*These mappings are the defaults, you can change them as described in|conjure-mappings| and |conjure-configuration|.See |conjure-client-python-stdio-configuration| for specific configurationoptions relevant to these mappings.<localleader>cs          Start the Python REPL if it's not running already.<localleader>cS          Stop any existing Python REPL.<localleader>ei          Interrupt running command. Same as pressing Ctrl-C                         in a cmdline REPL.==============================================================================CONFIGURATION                        *conjure-client-python-stdio-configuration*All configuration can be set as described in |conjure-configuration|.                                 *g:conjure#client#python#stdio#mapping#start*`g:conjure#client#python#stdio#mapping#start`            Start the Python REPL if it's not running already.            Default: `"cs"`                                  *g:conjure#client#python#stdio#mapping#stop*`g:conjure#client#python#stdio#mapping#stop`            Stop any existing Python REPL.            Default: `"cS"`                                       *g:conjure#client#python#stdio#command*`g:conjure#client#python#stdio#command`            Command used to start the Python REPL, you can modify this to add            arguments or change the command entirely. Tip: Start Neovim within            a Python virtual environment to make best use of the default            command.            Default: `"python3 -iq"`                                *g:conjure#client#python#stdio#prompt_pattern*`g:conjure#client#python#stdio#prompt_pattern`            Lua pattern to identify a new REPL prompt. This match signals to            Conjure that the previous evaluation is complete and we're ready            to submit more code as well as collect all output prior to the            marker as the result.            Default: `">>> "`                               *g:conjure#client#python#stdio#auto_set_file*`g:conjure#client#python#stdio#auto_set_file`            Automatically set `__file__` to the path of the buffer being            evaluated before each evaluation. Disable this if you're            evaluating scripts rather than modules and don't want `__file__`            defined in your REPL environment.            Default: `true`vim:tw=78:sw=2:ts=2:ft=help:norl:et:listchars=