Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97b2e69

Browse files
committed
Merge branch 'master' of gh:ivanov/vim-ipython
2 parents 7eb7c24 + ff8f88f commit 97b2e69

3 files changed

Lines changed: 41 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Thanks so much for reporting issues or proposing new changes to vim-ipython.
2+
3+
# Issues
4+
5+
If you are reporting an issue, please be sure to read through the [Known
6+
Issues](https://github.com/ivanov/vim-ipython#known-issues) portion of [the
7+
README document](/README.rst), as the most common issues, and their workaround
8+
are described there
9+
10+
# Pull requests
11+
12+
Thanks for making a pull request. Please be sure to add your GitHub username to
13+
the [Thanks and Bug
14+
Participation](https://github.com/ivanov/vim-ipython#thanks-and-bug-participation)
15+
list, and if it's a significant enough of a feature, to also add it somewhere
16+
within the overall guide found in the README.
17+
18+
best,
19+
pi

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ editor and REPL combination.
199199
Known issues:
200200
---------------
201201
- For now, vim-ipython only connects to an ipython session in progress.
202+
- The standard ipython clients (console, qtconsole, notebook) do not currently
203+
display the result of computation which they did not initialize. This means
204+
that if you send print statements for execution from within vim, they will
205+
only be shown inside the vim-ipython shell buffer, but **not** within any of
206+
the standard clients. This is not a limitation of vim-ipython, but a
207+
limitation of those built-in clients, see `ipython/ipython#1873
208+
<https://github.com/ipython/ipython/issues/1873>`_
202209
- The ipdb integration is not yet re-implemented. Pending
203210
[IPython PR #3089](https://github.com/ipython/ipython/pull/3089)
204211
- If you're running inside ``screen``, read about the ``<CTRL-S>`` issue `here

ftplugin/python/ipy.vim

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,25 @@ except NameError:
7878
kc = None
7979
pid = None
8080

81+
_install_instructions = """You *must* install IPython into the Python that
82+
your vim is linked against. If you are seeing this message, this usually means
83+
either (1) installing IPython using the system Python that vim is using, or
84+
(2) recompiling Vim against the Python where you already have IPython
85+
installed. This is only a requirement to allow Vim to speak with an IPython
86+
instance using IPython's own machinery. It does *not* mean that the IPython
87+
instance with which you communicate via vim-ipython needs to be running the
88+
same version of Python.
89+
"""
8190
def km_from_string(s=''):
8291
"""create kernel manager from IPKernelApp string
8392
such as '--shell=47378 --iopub=39859 --stdin=36778 --hb=52668' for IPython 0.11
8493
or just 'kernel-12345.json' for IPython 0.12
8594
"""
8695
from os.path import join as pjoin
96+
try:
97+
import IPython
98+
except ImportError:
99+
raise ImportError("Could not find IPython. " + _install_instructions)
87100
from IPython.config.loader import KeyValueConfigLoader
88101
from Queue import Empty
89102
try:
@@ -432,8 +445,8 @@ def with_subchannel(f,*args):
432445

433446
@with_subchannel
434447
def run_this_file():
435-
msg_id = send('run %s %s' % (run_flags, repr(vim.current.buffer.name),))
436-
print_prompt("In[]: run %s %s" % (run_flags, repr(vim.current.buffer.name)),msg_id)
448+
msg_id = send('%%run %s %s' % (run_flags, repr(vim.current.buffer.name),))
449+
print_prompt("In[]: %%run %s %s" % (run_flags, repr(vim.current.buffer.name)),msg_id)
437450

438451
@with_subchannel
439452
def run_this_line():

0 commit comments

Comments
 (0)