Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup script for Ipython #391

Open
mrsalo opened this issue May 2, 2019 · 2 comments
Open

Startup script for Ipython #391

mrsalo opened this issue May 2, 2019 · 2 comments

Comments

@mrsalo
Copy link

mrsalo commented May 2, 2019

In order to use and test out pynvim it would be beneficial to have a startup script for IPython that populates a connection to a local NeoVim instance without further setup required.
At least in Arch Linux AFAIK every NeoVim instance populates its API endpoint under /tmp/nvimRANDOM/0. This makes it possible to connect to every instance, echo a identifying message to the user to enable him/her choosing to which instance to connect to. If there is only one instance it is also possible to connect to it directly.
I created a small script that implements the above mentioned behviour. Is this interesting to anyone else?
Example:
Peek 2019-05-02 22-06

@justinmk
Copy link
Member

justinmk commented May 2, 2019

Sure. Here's something similar in my config: https://github.com/justinmk/config/blob/ad5b792049b352274d4cbd3525a2aff6ce296a7e/.config/nvim/init.vim#L1339-L1361

I think it might be a good idea to have some sort of convention where each client implements something like this. Then the user can just rpcrequest({chan}, 'repl').

Or it could simply be a plugin included with Nvim core runtime.

@mrsalo
Copy link
Author

mrsalo commented May 2, 2019

I thought about staying completely in neovim by starting Ipython in conjunction with :terminal similar as you did in your init.vim, too. The only problem is that i cannot use the convenient nvim.current .buffer anymore as i am referring to the :terminal buffer then.
That's why I chose to start IPython in another terminal.
I think I do not fully understand your rpcrequest({chan}, 'repl') suggestion, could you elaborate on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants