Show More
@@ -2262,11 +2262,11 b' Currently the magic system has the following functions:\\n"""' | |||||
2262 | Usage: |
|
2262 | Usage: | |
2263 | %edit [options] [args] |
|
2263 | %edit [options] [args] | |
2264 |
|
2264 | |||
2265 |
%edit runs IPython's editor hook. |
|
2265 | %edit runs IPython's editor hook. The default version of this hook is | |
2266 | set to call the __IPYTHON__.rc.editor command. This is read from your |
|
2266 | set to call the editor specified by your $EDITOR environment variable. | |
2267 |
|
|
2267 | If this isn't found, it will default to vi under Linux/Unix and to | |
2268 |
|
|
2268 | notepad under Windows. See the end of this docstring for how to change | |
2269 |
|
|
2269 | the editor hook. | |
2270 |
|
2270 | |||
2271 | You can also set the value of this editor via the |
|
2271 | You can also set the value of this editor via the | |
2272 | ``TerminalInteractiveShell.editor`` option in your configuration file. |
|
2272 | ``TerminalInteractiveShell.editor`` option in your configuration file. | |
@@ -2311,25 +2311,25 b' Currently the magic system has the following functions:\\n"""' | |||||
2311 | If arguments are given, the following possibilites exist: |
|
2311 | If arguments are given, the following possibilites exist: | |
2312 |
|
2312 | |||
2313 | - If the argument is a filename, IPython will load that into the |
|
2313 | - If the argument is a filename, IPython will load that into the | |
2314 | editor. It will execute its contents with execfile() when you exit, |
|
2314 | editor. It will execute its contents with execfile() when you exit, | |
2315 | loading any code in the file into your interactive namespace. |
|
2315 | loading any code in the file into your interactive namespace. | |
2316 |
|
2316 | |||
2317 | - The arguments are ranges of input history, e.g. "7 ~1/4-6". |
|
2317 | - The arguments are ranges of input history, e.g. "7 ~1/4-6". | |
2318 | The syntax is the same as in the %history magic. |
|
2318 | The syntax is the same as in the %history magic. | |
2319 |
|
2319 | |||
2320 | - If the argument is a string variable, its contents are loaded |
|
2320 | - If the argument is a string variable, its contents are loaded | |
2321 | into the editor. You can thus edit any string which contains |
|
2321 | into the editor. You can thus edit any string which contains | |
2322 | python code (including the result of previous edits). |
|
2322 | python code (including the result of previous edits). | |
2323 |
|
2323 | |||
2324 | - If the argument is the name of an object (other than a string), |
|
2324 | - If the argument is the name of an object (other than a string), | |
2325 | IPython will try to locate the file where it was defined and open the |
|
2325 | IPython will try to locate the file where it was defined and open the | |
2326 | editor at the point where it is defined. You can use `%edit function` |
|
2326 | editor at the point where it is defined. You can use `%edit function` | |
2327 | to load an editor exactly at the point where 'function' is defined, |
|
2327 | to load an editor exactly at the point where 'function' is defined, | |
2328 | edit it and have the file be executed automatically. |
|
2328 | edit it and have the file be executed automatically. | |
2329 |
|
2329 | |||
2330 | If the object is a macro (see %macro for details), this opens up your |
|
2330 | - If the object is a macro (see %macro for details), this opens up your | |
2331 | specified editor with a temporary file containing the macro's data. |
|
2331 | specified editor with a temporary file containing the macro's data. | |
2332 | Upon exit, the macro is reloaded with the contents of the file. |
|
2332 | Upon exit, the macro is reloaded with the contents of the file. | |
2333 |
|
2333 | |||
2334 | Note: opening at an exact line is only supported under Unix, and some |
|
2334 | Note: opening at an exact line is only supported under Unix, and some | |
2335 | editors (like kedit and gedit up to Gnome 2.8) do not understand the |
|
2335 | editors (like kedit and gedit up to Gnome 2.8) do not understand the |
@@ -235,17 +235,9 b' class ZMQInteractiveShell(InteractiveShell):' | |||||
235 | Usage: |
|
235 | Usage: | |
236 | %edit [options] [args] |
|
236 | %edit [options] [args] | |
237 |
|
237 | |||
238 | %edit runs IPython's editor hook. The default version of this hook is |
|
238 | %edit runs an external text editor. You will need to set the command for | |
239 | set to call the __IPYTHON__.rc.dditor command. This is read from your |
|
239 | this editor via the ``TerminalInteractiveShell.editor`` option in your | |
240 | environment variable $EDITOR. If this isn't found, it will default to |
|
240 | configuration file before it will work. | |
241 | vi under Linux/Unix and to notepad under Windows. See the end of this |
|
|||
242 | docstring for how to change the editor hook. |
|
|||
243 |
|
||||
244 | You can also set the value of this editor via the |
|
|||
245 | ``TerminalInteractiveShell.editor`` option in your configuration file. |
|
|||
246 | This is useful if you wish to use a different editor from your typical |
|
|||
247 | default with IPython (and for Windows users who typically don't set |
|
|||
248 | environment variables). |
|
|||
249 |
|
241 | |||
250 | This command allows you to conveniently edit multi-line code right in |
|
242 | This command allows you to conveniently edit multi-line code right in | |
251 | your IPython session. |
|
243 | your IPython session. | |
@@ -364,16 +356,7 b' class ZMQInteractiveShell(InteractiveShell):' | |||||
364 | Editing... done. Executing edited code... |
|
356 | Editing... done. Executing edited code... | |
365 | hello again |
|
357 | hello again | |
366 | Out[7]: "print 'hello again'n" |
|
358 | Out[7]: "print 'hello again'n" | |
367 |
|
359 | """ | ||
368 |
|
||||
369 | Changing the default editor hook: |
|
|||
370 |
|
||||
371 | If you wish to write your own editor hook, you can put it in a |
|
|||
372 | configuration file which you load at startup time. The default hook |
|
|||
373 | is defined in the IPython.core.hooks module, and you can use that as a |
|
|||
374 | starting example for further modifications. That file also has |
|
|||
375 | general instructions on how to set a new hook for use once you've |
|
|||
376 | defined it.""" |
|
|||
377 |
|
360 | |||
378 | opts,args = self.parse_options(parameter_s,'prn:') |
|
361 | opts,args = self.parse_options(parameter_s,'prn:') | |
379 |
|
362 |
General Comments 0
You need to be logged in to leave comments.
Login now