README.rst 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. ==============================================
  2. EIN -- Emacs IPython Notebook |build-status|
  3. ==============================================
  4. --- or **E**\ IN **I**\ s not only for **N**\ otebooks.
  5. .. note:: It is stable enough for my day to day work, but I can't
  6. guarantee the safety for your notebook data. So please make
  7. sure you have backup.
  8. .. |build-status|
  9. image:: https://secure.travis-ci.org/tkf/emacs-ipython-notebook.png
  10. ?branch=master
  11. :target: http://travis-ci.org/tkf/emacs-ipython-notebook
  12. :alt: Build Status
  13. Screenshot
  14. ==========
  15. .. figure:: https://github.com/tkf/emacs-ipython-notebook/raw/data/screenshots/notebook_simple_plot.png
  16. :alt: Plotting in Emacs IPython Notebook
  17. See `more <https://github.com/tkf/emacs-ipython-notebook/wiki/Screenshots>`_!
  18. Features
  19. ========
  20. Emacs IPython Notebook (EIN) provides a IPython Notebook client and
  21. integrated REPL (like SLIME_) in Emacs. While EIN makes notebook
  22. editing very powerful by allowing you to use any Emacs features, it
  23. also expose IPython features such as code evaluation, object
  24. inspection and code completion to the Emacs side. These features can
  25. be accessed anywhere in Emacs and improve Python code editing and
  26. reading in Emacs.
  27. .. _SLIME: http://common-lisp.net/project/slime/
  28. Highlighted features:
  29. * Copy/paste cells, even to/from different notebooks.
  30. * Console integration: You can easily connect to kernel via console
  31. application. This enables you to start debugging in the same
  32. kernel. It is even possible to connect console over ssh.
  33. * IPython kernel can be "connected" to any buffers. This enables you
  34. to evaluate buffer/region using same kernel as notebook. Notebook
  35. goodies such as tooltip help, help browser and code completion are
  36. available in these buffers.
  37. * Jump to definition (go to the definition by hitting ``M-.`` over an
  38. object).
  39. Other notebook features:
  40. * Inline images
  41. * Auto/manual-completion
  42. * Popup (tooltip) help
  43. * Syntax highlighting in each cell types (Python/Markdown)
  44. * Help browser (opens when executing ``function?``)
  45. * Traceback viewer
  46. Links:
  47. * `Online Documentation
  48. <http://tkf.github.com/emacs-ipython-notebook/>`_
  49. * `Wiki
  50. <https://github.com/tkf/emacs-ipython-notebook/wiki>`_
  51. + `Screenshots
  52. <https://github.com/tkf/emacs-ipython-notebook/wiki/Screenshots>`_
  53. + `Tips
  54. <https://github.com/tkf/emacs-ipython-notebook/wiki/Tips>`_
  55. * `Downloads
  56. <https://github.com/tkf/emacs-ipython-notebook/tags>`_
  57. * `Repository at GitHub
  58. <https://github.com/tkf/emacs-ipython-notebook>`_
  59. * `Issue Tracker at GitHub
  60. <https://github.com/tkf/emacs-ipython-notebook/issues>`_
  61. Quick try
  62. =========
  63. This is a quick and clean way to try EIN separately from your Emacs
  64. setting. If you want to try EIN but think preparing all the
  65. requirements is too much, try this!::
  66. git clone git://github.com/tkf/emacs-ipython-notebook.git
  67. cd emacs-ipython-notebook/
  68. lisp/zeroein.el
  69. This will launch a new Emacs instance.
  70. You can use environment variable ``EMACS`` to control Emacs executable
  71. to use.::
  72. EMACS=emacs-snapshot lisp/zeroein.el
  73. The above command requires /bin/sh. If the above command does not work
  74. (e.g., you are using MS Windows), try the following command::
  75. emacs -Q -l lisp/zeroein.el
  76. Requirements
  77. ============
  78. * IPython_ 0.12 or higher.
  79. * `websocket.el`_ 0.9
  80. * `request.el`_ >= 0.2
  81. * (optional) mumamo_ developmental version:
  82. It will be automatically loaded when it is on the path.
  83. The official way to setup path is to load nXhtml_.
  84. * (optional) markdown-mode
  85. * (optional) python-mode:
  86. It should work with either python.el or python-mode.el.
  87. Fabian Gallina's `python.el`_ is required to use
  88. ``ein:console-open`` command.
  89. * (optional) `auto-complete.el`_
  90. You need to configure subpackage ``ein-ac`` to enable
  91. this feature.
  92. * (optional) `smartrep.el`_:
  93. This package enables you to omit typing prefix keys (e.g.,
  94. ``C-c C-n C-n C-n ...`` instead of ``C-c C-n C-c C-n C-c C-n ...``).
  95. You need to configure subpackage ``ein-smartrep`` to enable
  96. this feature.
  97. Also, EIN heavily relies on standard Emacs libraries including EWOC,
  98. EIEIO and json.el. EIN is currently tested against Emacs 23.3 and 24.3.
  99. It is known to work in Emacs 23.2, 24.1 and 24.2.
  100. .. _IPython: http://ipython.org/
  101. .. _websocket.el: https://github.com/ahyatt/emacs-websocket
  102. .. _request.el: https://github.com/tkf/emacs-request
  103. .. _mumamo: http://www.emacswiki.org/emacs/MuMaMo
  104. .. _nXhtml: http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html
  105. .. _python.el: https://github.com/fgallina/python.el
  106. .. _auto-complete.el: http://cx4a.org/software/auto-complete/
  107. .. _smartrep.el: https://github.com/myuhe/smartrep.el
  108. Usage
  109. =====
  110. 1. Install module.
  111. Put Emacs lisp ``ein*.el`` files and Python file ``ein.py`` in your
  112. load path. See `online documentation`_ for more information.
  113. 2. Require module::
  114. (require 'ein)
  115. 3. Start `IPython notebook server`_.
  116. 4. Hit ``M-x ein:notebooklist-open`` to open notebook list.
  117. .. _`IPython notebook server`:
  118. http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html
  119. Subpackages
  120. -----------
  121. Enable `auto-complete.el`_::
  122. (setq ein:use-auto-complete t)
  123. ;; Or, to enable "superpack" (a little bit hacky improvements):
  124. ;; (setq ein:use-auto-complete-superpack t)
  125. Enable `smartrep.el`_::
  126. (setq ein:use-smartrep t)
  127. Keybinds - Notebook
  128. -------------------
  129. .. (ein:dev-insert-mode-map "\\{ein:notebook-mode-map}")
  130. ::
  131. key binding
  132. --- -------
  133. C-c Prefix Command
  134. C-x Prefix Command
  135. ESC Prefix Command
  136. . ein:notebook-complete-dot
  137. C-: ein:shared-output-eval-string
  138. <C-down> ein:worksheet-goto-next-input
  139. <C-up> ein:worksheet-goto-prev-input
  140. <M-S-return> ein:worksheet-execute-cell-and-insert-below
  141. <M-down> ein:worksheet-move-cell-down
  142. <M-up> ein:worksheet-move-cell-up
  143. C-x C-s ein:notebook-save-notebook-command
  144. C-x C-w ein:notebook-rename-command
  145. M-RET ein:worksheet-execute-cell-and-goto-next
  146. M-, ein:pytools-jump-back-command
  147. M-. ein:pytools-jump-to-source-command
  148. M-n ein:worksheet-next-input-history
  149. M-p ein:worksheet-previous-input-history
  150. C-c C-a ein:worksheet-insert-cell-above
  151. C-c C-b ein:worksheet-insert-cell-below
  152. C-c C-c ein:worksheet-execute-cell
  153. C-c C-e ein:worksheet-toggle-output
  154. C-c C-f ein:pytools-request-tooltip-or-help
  155. C-c TAB ein:completer-complete
  156. C-c C-k ein:worksheet-kill-cell
  157. C-c C-l ein:worksheet-clear-output
  158. C-c RET ein:worksheet-merge-cell
  159. C-c C-n ein:worksheet-goto-next-input
  160. C-c C-o ein:console-open
  161. C-c C-p ein:worksheet-goto-prev-input
  162. C-c C-q ein:notebook-kill-kernel-then-close-command
  163. C-c C-r ein:notebook-restart-kernel-command
  164. C-c C-s ein:worksheet-split-cell-at-point
  165. C-c C-t ein:worksheet-toggle-cell-type
  166. C-c C-u ein:worksheet-change-cell-type
  167. C-c C-v ein:worksheet-set-output-visibility-all
  168. C-c C-w ein:worksheet-copy-cell
  169. C-c C-x ein:tb-show
  170. C-c C-y ein:worksheet-yank-cell
  171. C-c C-z ein:notebook-kernel-interrupt-command
  172. C-c ESC Prefix Command
  173. C-c ! ein:worksheet-rename-sheet
  174. C-c + ein:notebook-worksheet-insert-next
  175. C-c - ein:notebook-worksheet-delete
  176. C-c 1 ein:notebook-worksheet-open-1th
  177. C-c 2 ein:notebook-worksheet-open-2th
  178. C-c 3 ein:notebook-worksheet-open-3th
  179. C-c 4 ein:notebook-worksheet-open-4th
  180. C-c 5 ein:notebook-worksheet-open-5th
  181. C-c 6 ein:notebook-worksheet-open-6th
  182. C-c 7 ein:notebook-worksheet-open-7th
  183. C-c 8 ein:notebook-worksheet-open-8th
  184. C-c 9 ein:notebook-worksheet-open-last
  185. C-c { ein:notebook-worksheet-open-prev-or-last
  186. C-c } ein:notebook-worksheet-open-next-or-first
  187. C-c C-S-l ein:worksheet-clear-all-output
  188. C-c C-# ein:notebook-close
  189. C-c C-' ein:worksheet-turn-on-autoexec
  190. C-c C-, ein:pytools-jump-back-command
  191. C-c C-. ein:pytools-jump-to-source-command
  192. C-c C-/ ein:notebook-scratchsheet-open
  193. C-c C-; ein:shared-output-show-code-cell-at-point
  194. C-c <down> ein:worksheet-move-cell-down
  195. C-c <up> ein:worksheet-move-cell-up
  196. C-c M-+ ein:notebook-worksheet-insert-prev
  197. C-c M-w ein:worksheet-copy-cell
  198. C-c M-{ ein:notebook-worksheet-move-prev
  199. C-c M-} ein:notebook-worksheet-move-next
  200. .. // KEYS END //
  201. Keybinds - Connect
  202. ------------------
  203. In Python (or any other) buffer, you can connect to any open notebook
  204. by ``M-x ein:connect-to-notebook`` then choose appropriate notebook.
  205. After connecting to the notebook (and hence its kernel), the following
  206. commands are available.
  207. .. (ein:dev-insert-mode-map "\\{ein:connect-mode-map}")
  208. ::
  209. key binding
  210. --- -------
  211. C-c Prefix Command
  212. ESC Prefix Command
  213. . ein:completer-dot-complete
  214. C-: ein:shared-output-eval-string
  215. M-, ein:pytools-jump-back-command
  216. M-. ein:pytools-jump-to-source-command
  217. C-c C-a ein:connect-toggle-autoexec
  218. C-c C-c ein:connect-run-or-eval-buffer
  219. C-c C-f ein:pytools-request-tooltip-or-help
  220. C-c TAB ein:completer-complete
  221. C-c C-l ein:connect-reload-buffer
  222. C-c C-o ein:console-open
  223. C-c C-r ein:connect-eval-region
  224. C-c C-x ein:tb-show
  225. C-c C-z ein:connect-pop-to-notebook
  226. C-c C-, ein:pytools-jump-back-command
  227. C-c C-. ein:pytools-jump-to-source-command
  228. C-c C-/ ein:notebook-scratchsheet-open
  229. .. // KEYS END //
  230. License
  231. =======
  232. Emacs IPython Notebook is licensed under GPL v3.
  233. See COPYING for details.