Giter Club home page Giter Club logo

iron.nvim's People

Contributors

alok avatar bpetri avatar calopter avatar cmcaine avatar doubleloop avatar even4void avatar f3fora avatar heregittygitty avatar hhoeflin avatar hkupty avatar jduc avatar leoatchina avatar lirorc avatar lucc avatar mike325 avatar milanglacier avatar mnacamura avatar nicodebo avatar randomizedthinking avatar resolritter avatar rickysaurav avatar sangdol avatar stephenprater avatar travonted avatar tsfoster avatar wbthomason avatar wdomitrz avatar xvrdm avatar yutkat avatar zegervdv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iron.nvim's Issues

Unable to return to editor pane

Thanks for a great plugin! Got me to move from vim to neovim.

Struggling embarrassingly with something that should be trivial but couldn't find the proper solution in documentation and searches.

Once I open a REPL from a py file using :IronRepl, how do I return focus to the editor? I wasn't able to find any way to get out of ipython and back into command mode.

Thanks!

remapping iron-send-motion unexpectedly overwrites ctr and nnoremap doesn't work at all.

Thanks for the plugin :)

From my init.vim:

" Map iron.vim
nnoremap <leader>r <Plug>(iron-send-motion)
vnoremap <leader>r <Plug>(iron-send-motion)

If I leave that excerpt in, the ctr mapping is not made. This behaviour is not documented.

Worse, my mapping doesn't work. If I make it an nmap rather than nnoremap mapping, then it works as expected. This is unusual and also not documented.

Feature request: 1 REPL per filetype

vimcmdline added support for this a while ago, and it's handy. All files of a given filetype share a REPL, and different filetypes have their own REPLs linked to them.

You could probably use a dictionary mapping filetypes to jobids to implement that, if it seems interesting/useful to you.

iron-send-motion moves cursor to the wrong place when repeated with `.`

search('aa*.?', 'baathomet')
search('aa*.?', 'bathomet')
search('aa*.?', 'a')
search('apple$', 'banapple')
search('^apple$', 'banapple')

Cursor on line 1, type ctr_ to send the first line.

j. to move one line down and repeat. Line 2 is sent to REPL, but cursor moves back to line 1 (it returns to the location of the original command). . on any other line will also return you to line 1.

It's due to how iron_cursor_pos is updated, but I don't think it needs to be stored at all.

Pull request incoming that removes iron_cursor_pos.

Issue with latest python repl

When running UpdateRemotePlugins I get the following error:

Encountered SyntaxError loading plugin at /home/zegervdv/.config/nvim/plugged/iron.nvim/rplugin/python3/iron: invalid syntax (__init__.py, line 21)
Traceback (most recent call last):
  File "/home/zegervdv/.local/lib/python3.5/site-packages/neovim/plugin/host.py", line 132, in _load
    module = imp.load_module(name, file, pathname, descr)
  File "/usr/lib/python3.5/imp.py", line 244, in load_module
    return load_package(name, filename)
  File "/usr/lib/python3.5/imp.py", line 216, in load_package
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "/home/zegervdv/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/repls/__init__.py", line 21
    python.ptipython,
         ^
SyntaxError: invalid syntax

Reverting to 2da42c8 solves the issue.

Keep track of opened REPLs

Currently, iron will open several REPLs if issued several times.

This issue intends to fix this. If issued to open a repl for an opened repl, will fail silently if the repl is opened.
If the buffer exists but is not opened, will open the buffer again.

This also implies in creating a bang version, forcing open a new REPL even if one exists.

autostart option

if you do a send motion when there's no repl open, you get the following error: neovim.api.nvim.NvimError: b'Vim:E900: Invalid job id'. Is there a way to add autostart, so that it will instead open a REPL and then carry out the send motion if no REPL is already open?

how to replace IronPromtComman for working with virtual environments?

Hi, I am really thankful for the iron package since it allows me to work with ipython,R and the shell at the same time.
When working in python I usually work in virtual environments.
Up to now I did this by issuing an

IronPromtCommand
and then write something like :"source my_virtual_env/bin/activate ; ipython"
This also worked with the Django database shell:
IronPromtCommand
""source my_virtual_env/bin/activate ; path/to/djangos/mysite/dir/manage.py shell"

I do not know how to accomplish these tasks now.
I think it should be really easy to create customized repls for these cases with a small lua file like with iron.core.add_repl_definitions{....
Is this the way to go?
A concrete example in the Readme would really help.

Thanks in advance

Install, Error when UpdateRemotePlugins

Hello, I am finding an error when executing UpdateRemotePlugins, which results in not having the commands available (IronRepl etc... only see two commands: IronUnwatchCurrentFile and IronWatchCurrentFile).
The error I get when executing UpdateRemotePlugins is:

Encountered ModuleNotFoundError loading plugin at C:/Users/benig/.local/share/nvim/plugged/iron.nvim/rplugin/python3/iron: No module named 'iron.zen' Traceback (most recent call last): File "C:\tools\miniconda3\lib\site-packages\neovim\plugin\host.py", line 130, in _load module = imp.load_module(name, file, pathname, descr) File "C:\tools\miniconda3\lib\imp.py", line 245, in load_module return load_package(name, filename) File "C:\tools\miniconda3\lib\imp.py", line 217, in load_package return _load(spec) File "<frozen importlib._bootstrap>", line 684, in _load File "<frozen importlib._bootstrap>", line 665, in _load_unlocked ModuleNotFoundError: No module named 'iron.zen' Encountered ModuleNotFoundError loading plugin at C:/Users/benig/.local/share/nvim/plugged/iron.nvim/rplugin/python3/migrate.py: No module named 'iron' Traceback (most recent call last): File "C:\tools\miniconda3\lib\site-packages\neovim\plugin\host.py", line 130, in _load module = imp.load_module(name, file, pathname, descr) File "C:\tools\miniconda3\lib\imp.py", line 235, in load_module return load_source(name, filename, file) File "C:\tools\miniconda3\lib\imp.py", line 172, in load_source module = _load(spec) File "<frozen importlib._bootstrap>", line 684, in _load File "<frozen importlib._bootstrap>", line 665, in _load_unlocked ModuleNotFoundError: No module named 'iron' remote/host: python3 host registered plugins ['deoplete'] remote/host: generated rplugin manifest: C:\Users\benig\AppData\Local\/nvim/rplugin.vim

I am running neovim latest version under windows with both python2 and 3 support. Anything I am doing wrong ?

Thanks for your help,
Benigno.

how to cancel command in REPL

sometimes i send input to a python repl and it ends up mangled and i have to switch to the repl buffer and <c-c> that input. is there a way to send the <c-c > with iron?

let g:iron_repl_open_cmd = 'topleft vertical 80 split" error caught in async

Hi:

I added let g:iron_repl_open_cmd = 'topleft vertical 80 split' & used key
autocmd Filetype python nmap <localleader>\\ :call IronSend(getline('.'))<CR><ESC><C-w>jG<C-w>pj0
and I get:

error caught in async handler '/home/hoon/.local/share/nvim/site/plugged/iron.nvim/rplugin/python3/iron:function:IronSend [['from datetime import datetime']]'
Traceback (most recent call last):
File "/home/hoon/.local/share/nvim/site/plugged/iron.nvim/rplugin/python3/iron/init.py", line 166, in send_to_repl
self.send_data(data, repl)
File "/home/hoon/.local/share/nvim/site/plugged/iron.nvim/rplugin/python3/iron/base.py", line 115, in send_data
ft = repl['ft']
KeyError: 'ft'

but autocmd Filetype python vmap <buffer> <localleader>\\ $<Plug>(iron-send-motion)
key works fine.
Is there another command I should use?
Thank u much,

Hoon,

Clojure boot repl

Please, add boot repl support. Lein is great but some people prefer boot.

tqdm incompatibility

Using Python's tqdm package for status bars when running in IPython through :IronRepl results in a long scrolling screen rather than the expected progress bar updating behavior. The progress bar should fill without scrolling the terminal buffer.

This appears to also be an issue when using the :term command. Maybe this is a NeoVim issue?

Edit: never mind. This appears to be a result of misuse of tqdm. Sorry for posting.

Error on first usage of :IronRepl

The first time i run :IronRepl i get the folloing error. After that it seems to work. I also can't seem to send any text to the repl "ctr$" just does nothing.

Error detected while processing function remote#define#CommandBootstrap[5]..remote#define#request:
line 2:
error caught in request handler '/home/roman/.config/nvim/plugged/iron.nvim/rplugin/python3/iron:command:IronRepl [0]':
Traceback (most recent call last):
File "/home/roman/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/init.py", line 70, in create_repl
self.iron_repl([ft], bang=bang)
File "/home/roman/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/init.py", line 101, in iron_repl
self.open_repl(template, **kwargs)
File "/home/roman/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/base.py", line 311, in open_repl
create_new_repl()
File "/home/roman/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/base.py", line 300, in create_new_repl
repl_id = self.termopen(command, with_placement)
File "/home/roman/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/base.py", line 93, in termopen
return open_term(self.nvim, cmd)
File "/home/roman/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/zen/ui.py", line 81, in open_term
ret = nvim.funcs.termopen(cmd)
File "/usr/lib/python3.6/site-packages/neovim/api/nvim.py", line 229, in call
return self.request('nvim_call_function', name, args, **kwargs)
File "/usr/lib/python3.6/site-packages/neovim/api/nvim.py", line 130, in request
res = self._session.request(name, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 97, in request
raise self.error_wrapper(err)
neovim.api.nvim.NvimError: b'Vim:Can only call this function in an unmodified buffer'
Error detected while processing function remote#define#CommandBootstrap:
line 5:
E171: Missing :endif

Installation, zen.nvim dependency

When running UpdateRemotePlugins, nvim gives me teh creeps about python module zen.nvim not found. There is 1/2 page of error messages, and after that, nothing works. Is there any step by step installation guide, please?

ptipython: multiline not working

Hey,
When sending multiple lines on the pyipython REPL (for example ctr }), only the first line is interpreted by the ptipython terminal window. Setting the pyipython to paste mode (in the config file, as F6 key is not registered by neovim terminal) I can see that the REPL is receiving all the lines, but only the first one is interpreted.

Thanks for adding more REPL (R, ptpython etc..) it's really great.

How to set a REPL for a filetype?

It seems like iron.nvim automatically sets up the REPL type or prompts for one. Is there a way to set your own default REPL for a filetype?

Missing license file

The documentation says that the plugin is free to use and extend, but I haven't found a detailed description of the rights granted to the users. For example, are users allowed to redistribute their extended version of the program? And could somebody include this program as part of a software released under a proprietary license?

With github, you can easily choose a license from the popular options and add the corresponding file to the repository. EDIT: I see that your other repositories contain licenses, so you probably already knew about this ;)

Cannot send multiple lines with ctr

Thank you for writing this plugin, and for making it available!

I encountered a problem when sending multiple lines to the REPL. Minimal setup:
minimalvimrc:

set nocompatible

let &rtp  = '~/.config/nvim/plugged/iron.nvim,' . &rtp

tnoremap <Esc> <C-\><C-N>

filetype plugin indent on
syntax enable

test.py:

def test():
    return 42

test()

If I open nvim with nvim -u minimalvimrc +'IronRepl' test.py and type <Esc><C-W>kctrG, I see the following in the REPL window

In [1]: 0~def test():
   ...:         return 42
  File "<ipython-input-somenumber>", line 1
    0~def test():
     ^
SyntaxError: invalid syntax



In [2]:

In [2]: test()1~
  File "<ipython-input-somenumber>", line 1
    test()1~
          ^
SyntaxError: invalid syntax

Thus, it seems that there is an extra 0~ inserted at the beginning of the lines I send, and an extra 1~ at the end, which of course confuses python. If I only send a single line, this problem does not occur.

I'm am on Ubuntu 16.04, with Python 2.7.12, IPython 2.4.1 and nvim v0.2.0. The same thing happens if I use :IronPromptCommand and pick IPython3, in which case I am on Python 3.5.2.

I hope this is just due to some simple misconfiguration on my end!

`set timeoutlen=` too low breaks `ctr`

I guess this is obvious but I've been working with set timeoutlen=50 for a long time without problems. Took me a while to track down the problem so I leave it here in case it happens to someone else.

iron does not honor prompt color set in ipython configuration

I noticed that the IPython REPL does not honor the prompt color scheme I specified in my ipython_config.py

I am trying to use the red and green specified by the Gruvbox Scheme.

When I start ipython in command line, the color shows up fine.
ipython

As you can see, I overrode the Token.OutPrompt and Token.Prompt colors using highlighting_style_overrides.

However, the same exact IPython started by iron does not reflect these overrides (despite the fact that the override values show up when I query get_ipython().highlighting_style_overrides

repl

I took a quick look at the source code, and I don't think you are hardcoding this anywhere.

But other than this issue, iron.nvim is the bees knees.

Thanks

Make REPLs pwd-bound

In continuation of #15, currently open REPLs will be aware of their pwd, so one can have multiple REPLs for the same ft running, each on a different path.

Sending text moves cursor

So I type ctrip at the end of the line print(3) where my cursor is at the end of the line and it moves my cursor to the beginning of the line.

Is it possible to make it not do that?

Clojure set ns to current file doesn't work with buffers in /tmp/

If I'm in a clojure project and I use acid.nvim to go to the definition of a library's function it will open that function's file in a temporary directory like /tmp/random-id/the-lib/misc.clj

When using iron.nvim's <leader>sn to make the repl's namespace match that /tmp/random-id... buffer's namespace I get (in-ns misc) instead of the expected (in-ns the-lib.misc)

Fixing this will allow one to more easily change the definition of a lib's function during exploratory development; something that is possible in emacs development flows

open repl in vsplit instead of horizontal split

Currently, it seems that running :IronRepl opens up the repl in a horizontal split at the bottom of vim. Is it possible to make the repl open in a vertical split on the right half of vim?

Sending multiline motion fails on Neovim v0.3.1

I'm using Neovim v0.3.1 and python3-neovim v0.2.6, I get this exception when sending motions like ii, ap:

error caught in async handler '/home/sviatoslav/.config/nvim/plugged/iron.nvim/rplugin/python3/iron:function:IronSendMotion [['line'], [1, 1]]'
Traceback (most recent call last):
  File "/home/sviatoslav/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/__init__.py", line 157, in send_motion_to_repl
    self.call('winrestview', cur_buf.vars['iron_cursor_pos'])
  File "/home/sviatoslav/.config/nvim/plugged/iron.nvim/rplugin/python3/iron/base.py", line 154, in call
    return self.nvim.call(cmd, *args)
  File "/home/sviatoslav/.local/share/virtualenvs/project-c9MqqoZ0/lib/python3.6/site-packages/neovim/api/nvim.py", line 284, in call
    return self.request('nvim_call_function', name, args, **kwargs)
  File "/home/sviatoslav/.local/share/virtualenvs/project-c9MqqoZ0/lib/python3.6/site-packages/neovim/api/nvim.py", line 170, in request
    res = self._session.request(name, *args, **kwargs)
  File "/home/sviatoslav/.local/share/virtualenvs/project-c9MqqoZ0/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 100, in request
    raise self.error_wrapper(err)
neovim.api.nvim.NvimError: b'Vim:E474: Invalid argument'

This same works fine in Neovim v0.2.2.

I can't install iron.nvim

I'm a young man in the vim world and the programming. May you explain more detailed how to install iron-nvim, nvim-ipy and etc? Thank you very much in advance.

Python version and virtualenv support

  1. Provide an option to launch chosen version of Python repl. I think :IronRepl should use default Python version, while :IronPromptRepl should let you choose between python, python2, python3, with python being alias for default Python version.

  2. When run inside virtualenv :IronRepl should choose appropriate Python version.

ctr resulting in KeyError

Not sure if I am doing this wrong or there is a bug. But every time I have text selected, i.e. in visual-mode, and I execute ctr. I experience the following error.

error caught in async handler '/home/username/.vim/plugged/iron.nvim/rplugin/python3/iron:function:IronSendMotion [['visual'], [1, 1]]'
Traceback (most recent call last):
  File "/home/username/.vim/plugged/iron.nvim/rplugin/python3/iron/__init__.py", line 144, in send_motion_to_repl
    return self.send_to_repl(["\n".join(text)])
  File "/home/username/.vim/plugged/iron.nvim/rplugin/python3/iron/__init__.py", line 166, in send_to_repl
    self.send_data(data, repl)
  File "/home/username/.vim/plugged/iron.nvim/rplugin/python3/iron/base.py", line 115, in send_data
    ft = repl['ft']
KeyError: 'ft'
Press ENTER or type command to continue

Any insights?

Extra spaces in front processing? (not a bug but a feature add?)

It's awesome but when compared to Emacs or Atom, I miss the ability to take code chunk with extra spaces in front. (visual selection)

import os
print("hello")
os.getenv('PATH')

can be sent directly to repl vs visual selection, but not:

    import os
    print("hello")
    os.getenv('PATH')

with extra spaces in front. Some simple processing to remove extra spaces in front would be great.
Wishful but not a show stopper.
Thanks u much for making ssh work so much easier!

how to move back to code?

Hi,

I would like to use use your program but I am having issues moving back from the ipython console to the code area (buffer)?

Can you help me with this real quick? Many thanks and sorry about this stupid question.

How do I move between the two windows?

If I do :split and get two "windows" then I can move between them by doing CTRL+W but this doesn't seem to work in this case.

Sorry if this is very obvious but I'm relatively new to vim plugins.

thank you

Send text in Visual mode

Hey,

Quick suggestion/question: often, it's convenient to select some text in visual mode and send it to the REPL rather than typing a motion.

There is surely an easy mapping/implementation to do that but my knowledge in vim plugins is close to 0 (shame on me) and if it's fast for you, I would really appreciate a little help.

What I did that kinda work for my ipython repl is:
vmap s <ESC>`>a<space><ESC>ctr`<
but as you can see, this adds a space at the end of the selection before sending otherwise it was sending the selected text minus the last character for some reason.

As this "solution" is pretty clunky, would you have another suggestion or would it be possible to implement another mapping like the ctr but for visual mode ?

Thanks a lot

IronREPL does not seem to have a normal mode

Thank you for this very exciting plugin for nvim. Perhaps I misunderstand the functionality, but everytime I run :IronRepl I am entered into the repl with no escape except to exit the repl. The escape key appears to be sent to the other side. I tested this using both standard python repl and ipython. If I attempt to change buffers (e.g. <C-W>j) I do not see a buffer change. I have to exit the repl. I get the impression that this should be standard functionality. I am at a loss as to solving the problem. It would be great to be able to copy text from the REPL or move to a file buffer and be able to send selected text. I attempted to disable everything in my vimrc except the installation of iron through Vundle with no luck. Thanks in advance for any advice in better understanding the usage of iron.nvim.

Multiline ipython not working in linux - needs an additional '\n'

When I select multiple lines and sent to the IPython REPL it waits for more input before it evaluates. I can make it evaluate by either switching to the REPL and add a CR or send an empty line.

I fixed it locally by adding an additional \n to the python specific repl: 'multiline': ('\x1b[200~', '\x1b[201~', '\r\n'), , I was going to make a pull request but I don't know if that breaks things for others. Let me know if you like me to do it. I think \r only works on OSX. I'm not entirely sure how it's evaluated, an os specific os.linesep might be better if it's evaluated in python.

Thanks for plugin!

how to call IronSend?

This may be more an issue with my configuration, but I'm not finding the command IronSend. I can access these commands but not any others:

IronClearReplDefinition 
IronDumpReplDefinition
IronPromptCommand
IronPromptRepl           
IronRepl

I'm using the latest versions of iron.nvim, nvim, neovim-python-client, and I did run UpdateRemotePlugins.

scroll terminal after IronSend

I use the REPL actively from the text editor and I made some custom bindings to IronSend to send text from the editor and watch the output on the REPL. The problem is that for a long output the terminal never scrolls down, so after a few IronSends, my output is already hidden. Is it possible to scroll the terminal down after each IronSend?

Using iron.nvim with Python 3 via Homebrew

Hi,

I tried finding an answer for this somewhere but couldn't find it in the documentation or in the open/closed issues:

How can I use iron.nvim plugin with Python 3 as installed by Homebrew instead of the default/built-in Python? The path is /usr/local/bin/python3.

I tried :IronPromptRepl but I don't think it can do what I want.

Thanks.

Feature request: allow more control over the spawned REPL split

So the REPL split is not at all nice looking. It's too large a lot of time as it takes up the bottom half of the screen. I think a better approach would be to allow something like the following. I use GoldenView to get nice splits, but that could be left out.

    call GoldenView#Split()
    enew | call termopen('python')

Slime.vim does this, and gets the terminal jobid to figure out where to send text. I wonder if something equivalent is possible here without a bunch of code.

request: add "send CR"

sometimes the python files need another CR to be sent, so allowing it to be sent manually would really alleviate that problem.

Test issue

Just a test issue. Should be disconsidered.

Connect to remote REPL

It would be great if this plugin could be configured to connect to a remote REPL (via ssh, for instance).

Scheme language REPLs

Please, add some repl configs for scheme (Guile for instance). Or, please, write the instruction about adding new repls by hand. I'am stupid enough to not making Guile to work with iron

With Clojure, can I connect to an existing REPL?

I have a running Clojure REPL started somewhen. I want to connect to it and reload my vim code into it while it's running to change behavior while testing.

Hello iron.vim, am I on the right project? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.