@@ -14,31 +14,36 @@ execute, and also get back object introspection and word completions in
14
14
Vim, like what you get with: ``object?<enter> `` and ``object.<tab> `` in
15
15
IPython.
16
16
17
- The big change from previous versions of ``ipy.vim `` is that it no longer
18
- requires the old brittle ``ipy_vimserver.py `` instantiation, and since
17
+ The big change from previous versions of ``ipy.vim `` is that it no longer
18
+ requires the old brittle ``ipy_vimserver.py `` instantiation, and since
19
19
it uses just vim and python, it is platform independent (i.e. should work
20
20
even on windows, unlike the previous \* nix only solution). The requirements
21
21
are IPython 0.11+ with zeromq capabilities, vim compiled with +python.
22
22
23
- If you can launch ``ipython qtconsole `` and ``:echo has('python') `` returns 1
24
- in vim, you should be good to go.
23
+ If you can launch ``ipython qtconsole `` or ``ipython kernel ``, and
24
+ `` :echo has('python') `` returns 1 in vim, you should be good to go.
25
25
26
26
-----------------
27
27
Quickstart Guide:
28
28
-----------------
29
29
Start ``ipython qtconsole `` [*]_ and copy the connection string.
30
30
Source ``ipy.vim `` file, which provides new IPython command::
31
31
32
- :source ipy.vim
32
+ :source ipy.vim
33
33
(or copy it to ~/.vim/ftplugin/python to load automatically)
34
34
35
- :IPythonClipboard
35
+ :IPythonClipboard
36
36
(or :IPythonXSelection if you're using X11 without having to copy)
37
37
38
- The :IPython command allows you to put the full string, e.g.::
38
+ The :IPython command allows you to put the full connection string. For IPython
39
+ 0.11, it would look like this::
39
40
40
41
:IPython --existing --shell=41882 --iopub=43286 --stdin=34987 --hb=36697
41
42
43
+ and for IPython 0.12, like this::
44
+
45
+ :IPython --existing kernel-85997.json
46
+
42
47
The ``:IPythonClipboard `` command just uses the ``+ `` register to get the
43
48
connection string, whereas ``:IPythonXSelection `` uses the ``* `` register
44
49
@@ -77,7 +82,7 @@ It also works blockwise in Visual Mode. Select and send these lines using
77
82
'%d'*len(code)%code == str(int(math.pi*1e5))
78
83
79
84
Then, go to the qtconsole and run this line::
80
-
85
+
81
86
print secret_decoder(_i,_)
82
87
83
88
You can also send whole files to IPython's ``%run `` magic using ``<F5> ``.
@@ -106,7 +111,7 @@ vim-ipython 'shell'
106
111
**NEW since IPython 0.11 **!
107
112
108
113
By monitoring km.sub_channel, we can recreate what messages were sent to
109
- IPython, and what IPython sends back in response.
114
+ IPython, and what IPython sends back in response.
110
115
111
116
``monitor_subchannel `` is a parameter that sets whether this 'shell' should
112
117
updated on every sent command (default: True).
@@ -124,6 +129,7 @@ You can change these at the top of the ipy.vim::
124
129
monitor_subchannel = True # update vim-ipython 'shell' on every send?
125
130
run_flags= "-i" # flags to for IPython's run magic when using <F5>
126
131
132
+ **Disabling default mappings **
127
133
In your own ``.vimrc ``, if you don't like the mappings provided by default,
128
134
you can define a variable ``let g:ipy_perform_mappings=0 `` which will prevent
129
135
vim-ipython from defining any of the default mappings.
@@ -135,25 +141,25 @@ Current issues:
135
141
- The ipdb integration is not yet re-implemented.
136
142
- If you're running inside ``screen ``, read about the ``<CTRL-S> `` issue `here
137
143
<http://munkymorgy.blogspot.com/2008/07/screen-ctrl-s-bug.html> `_, and add
138
- this line to your ``.bashrc `` to fix it::
144
+ this line to your ``.bashrc `` to fix it::
139
145
140
- stty stop undef # to unmap ctrl-s
146
+ stty stop undef # to unmap ctrl-s
141
147
142
148
- In vim, if you're getting ``ImportError: No module named
143
149
IPython.zmq.blockingkernelmanager `` but are able to import it in regular
144
150
python, **either **
145
151
146
152
1. your ``sys.path `` in vim differs from the ``sys.path `` in regular python.
147
153
Try running these two lines, and comparing their output files::
148
-
154
+
149
155
$ vim -c 'py import vim, sys; vim.current.buffer.append(sys.path)' -c ':wq vim_syspath'
150
156
$ python -c "import sys; f=file('python_syspath','w'); f.write('\n'.join(sys.path)); f.close()"
151
-
157
+
152
158
**or **
153
159
154
160
2. your vim is compiled against a different python than you are launching. See
155
161
if there's a difference between ::
156
-
162
+
157
163
$ vim -c ':py import os; print os.__file__' -c ':q'
158
164
$ python -c ':py import os; print os.__file__'
159
165
@@ -170,15 +176,14 @@ Current issues:
170
176
``monitor_subchannel `` is set. This is a bug in minibufexpl.vim and the workaround
171
177
is described in vim-ipython issue #7.
172
178
173
- ------
174
- Thanks
175
- ------
179
+ ----------------------------
180
+ Thanks and Bug Participation
181
+ ----------------------------
176
182
* @MinRK for guiding me through the IPython kernel manager protocol.
177
-
178
- *Bugs *
179
-
180
183
* @nakamuray and @tcheneau for reporting and providing a fix for when vim is compiled without a gui (#1)
181
184
* @unpingco for reporting Windows bugs (#3,#4)
182
185
* @simon-b for terminal vim arrow key issue (#5)
183
186
* @jorgesca and @kwgoodman for shell (#6)
184
187
* @zeekay for easily allowing custom mappings (#9)
188
+ * @minrk for support of connection_file-based IPython connection (#13)
189
+ * @jorgesca for reporting the lack of profile handling capability (#14)
0 commit comments