2015-12-02 14:23:39 +00:00
|
|
|
#+TITLE: IPython Notebook layer
|
2015-06-10 16:44:30 +00:00
|
|
|
|
2016-03-31 02:59:55 +00:00
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#description][Description]]
|
|
|
|
- [[#features][Features]]
|
|
|
|
- [[#list-of-todos][List of TODOS]]
|
|
|
|
- [[#maybe-itd-be-better-if-there-was-a-state-for-this][Maybe it'd be better if there was a state for this]]
|
|
|
|
- [[#make-more-keybinding-to-connect-to-a-python-buffer][Make more keybinding to =connect= to a python buffer]]
|
|
|
|
- [[#deleting-visual-regions-dont-work-find-out-why][Deleting visual regions don't work, find out why]]
|
|
|
|
- [[#install][Install]]
|
|
|
|
- [[#layer][Layer]]
|
|
|
|
- [[#dependencies][Dependencies]]
|
|
|
|
- [[#what-needs-to-be-run][What needs to be run]]
|
|
|
|
- [[#using-the-ipython-notebook][Using the IPython notebook]]
|
|
|
|
- [[#open-notebook-list][Open Notebook List]]
|
|
|
|
- [[#key-bindings][Key Bindings]]
|
|
|
|
- [[#transient-state-ipython-notebook][Transient-state: =ipython-notebook=]]
|
|
|
|
- [[#normal-mode][Normal mode]]
|
|
|
|
- [[#insert-mode][Insert mode]]
|
|
|
|
- [[#traceback-mode][Traceback mode]]
|
|
|
|
- [[#screenshots][Screenshots]]
|
|
|
|
- [[#light][Light]]
|
|
|
|
- [[#dark][Dark]]
|
|
|
|
- [[#bonus][Bonus]]
|
2015-06-10 16:44:30 +00:00
|
|
|
|
2015-07-27 19:50:52 +00:00
|
|
|
* Description
|
2015-06-06 00:20:15 +00:00
|
|
|
This layer adds support for the package =emacs-ipython-notebook=.
|
|
|
|
|
|
|
|
Do not hesitate to check the original package README [[https://github.com/millejoh/emacs-ipython-notebook][here]]. Also the wiki has
|
|
|
|
lots of informative stuff.
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
* Features
|
2016-01-30 11:32:53 +00:00
|
|
|
- Keybindings available through transient-state or leader key
|
2015-06-06 00:20:15 +00:00
|
|
|
- Lazy-loading
|
2015-06-08 03:33:33 +00:00
|
|
|
|
2015-06-10 21:16:01 +00:00
|
|
|
* List of TODOS
|
|
|
|
This is a WIP, feel free to collaborate.
|
2016-04-13 03:31:38 +00:00
|
|
|
|
2015-06-10 21:16:01 +00:00
|
|
|
** TODO Maybe it'd be better if there was a state for this
|
2016-04-13 03:31:38 +00:00
|
|
|
** TODO Make more keybinding to =connect= to a python buffer
|
|
|
|
** TODO Deleting visual regions don't work, find out why
|
2015-06-06 00:20:15 +00:00
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
* Install
|
|
|
|
** Layer
|
2016-01-06 05:21:55 +00:00
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
2016-01-21 15:33:44 +00:00
|
|
|
add =ipython-notebook= to the existing =dotspacemacs-configuration-layers= list
|
2016-01-06 05:21:55 +00:00
|
|
|
in this file.
|
2016-04-13 03:31:38 +00:00
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
** Dependencies
|
2016-06-23 01:24:43 +00:00
|
|
|
Install IPython Notebook > 3
|
2015-06-06 00:20:15 +00:00
|
|
|
#+begin_src sh
|
2016-06-23 01:24:43 +00:00
|
|
|
pip install ipython[notebook]
|
2015-06-06 00:20:15 +00:00
|
|
|
#+end_src
|
2016-04-13 03:31:38 +00:00
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
** What needs to be run
|
2015-06-10 21:16:01 +00:00
|
|
|
Have an IPython notebook running
|
2015-06-06 00:20:15 +00:00
|
|
|
#+begin_src sh
|
|
|
|
ipython notebook
|
|
|
|
#+end_src
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
* Using the IPython notebook
|
|
|
|
** Open Notebook List
|
2016-01-30 11:32:53 +00:00
|
|
|
This layer is lazy loaded so the transient-state will only work after you summon the
|
2015-06-12 01:23:07 +00:00
|
|
|
command =ein:notebooklist-open= which is bound to ~SPC a i n~
|
2016-04-13 03:31:38 +00:00
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
** Key Bindings
|
2016-01-30 11:32:53 +00:00
|
|
|
The key bindings can be used through a transient state or the usual evil-leader.
|
2015-06-08 22:49:07 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
*** Transient-state: =ipython-notebook=
|
|
|
|
Once you are in the ipython notebook you can activate the transient-state with
|
2016-06-18 02:51:34 +00:00
|
|
|
~SPC m .~
|
2015-06-08 22:49:07 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
The following table lists the keys. Use them as listed in the transient-state or
|
2015-06-12 01:23:07 +00:00
|
|
|
prefix with ~SPC m~ to use with your evil-leader.
|
2015-06-06 00:20:15 +00:00
|
|
|
|
|
|
|
| Key | Function |
|
|
|
|
|---------+-------------------------------------------|
|
2015-06-10 16:44:30 +00:00
|
|
|
| ~h~ | ein:notebook-worksheet-open-prev-or-last |
|
|
|
|
| ~j~ | ein:worksheet-goto-next-input |
|
|
|
|
| ~k~ | ein:worksheet-goto-prev-input |
|
|
|
|
| ~l~ | ein:notebook-worksheet-open-next-or-first |
|
|
|
|
| ~H~ | ein:notebook-worksheet-move-prev |
|
|
|
|
| ~J~ | ein:worksheet-move-cell-down |
|
|
|
|
| ~K~ | ein:worksheet-move-cell-up |
|
|
|
|
| ~L~ | ein:notebook-worksheet-move-next |
|
|
|
|
| ~t~ | ein:worksheet-toggle-output |
|
|
|
|
| ~d~ | ein:worksheet-kill-cell |
|
|
|
|
| ~R~ | ein:worksheet-rename-sheet |
|
|
|
|
| ~y~ | ein:worksheet-copy-cell |
|
|
|
|
| ~p~ | ein:worksheet-yank-cell |
|
2015-08-17 18:25:48 +00:00
|
|
|
| ~i~ | ein:worksheet-insert-cell-below |
|
|
|
|
| ~I~ | ein:worksheet-insert-cell-above |
|
2015-06-10 16:44:30 +00:00
|
|
|
| ~u~ | ein:worksheet-change-cell-type |
|
|
|
|
| ~RET~ | ein:worksheet-execute-cell-and-goto-next |
|
|
|
|
| ~C-l~ | ein:worksheet-clear-output |
|
|
|
|
| ~C-S-l~ | ein:worksheet-clear-all-output |
|
|
|
|
| ~C-o~ | ein:console-open |
|
|
|
|
| ~C-k~ | ein:worksheet-merge-cell |
|
|
|
|
| ~C-j~ | spacemacs/ein:worksheet-merge-cell-next |
|
|
|
|
| ~C-s~ | ein:notebook-save-notebook-command |
|
|
|
|
| ~C-r~ | ein:notebook-rename-command |
|
|
|
|
| ~1~ | ein:notebook-worksheet-open-1th |
|
|
|
|
| ~2~ | ein:notebook-worksheet-open-2th |
|
|
|
|
| ~3~ | ein:notebook-worksheet-open-3th |
|
|
|
|
| ~4~ | ein:notebook-worksheet-open-4th |
|
|
|
|
| ~5~ | ein:notebook-worksheet-open-5th |
|
|
|
|
| ~6~ | ein:notebook-worksheet-open-6th |
|
|
|
|
| ~7~ | ein:notebook-worksheet-open-7th |
|
|
|
|
| ~8~ | ein:notebook-worksheet-open-8th |
|
|
|
|
| ~9~ | ein:notebook-worksheet-open-last |
|
|
|
|
| ~+~ | ein:notebook-worksheet-insert-next |
|
|
|
|
| ~-~ | ein:notebook-worksheet-delete |
|
|
|
|
| ~x~ | ein:notebook-close |
|
2015-06-15 20:19:02 +00:00
|
|
|
|
|
|
|
*** Normal mode
|
|
|
|
In normal mode the following key bindings are defined:
|
|
|
|
|
|
|
|
| Key | Function |
|
|
|
|
|---------+------------------------------------------|
|
|
|
|
| ~gj~ | ein:worksheet-goto-next-input |
|
|
|
|
| ~gk~ | ein:worksheet-goto-prev-input |
|
|
|
|
| ~C-RET~ | ein:worksheet-execute-cell |
|
|
|
|
| ~S-RET~ | ein:worksheet-execute-cell-and-goto-next |
|
|
|
|
|
2015-06-16 02:56:55 +00:00
|
|
|
Also ~SPC f s~ saves the notebook like you would a regular buffer.
|
2015-06-15 20:19:02 +00:00
|
|
|
|
|
|
|
*** Insert mode
|
|
|
|
In normal mode the following key bindings are defined:
|
|
|
|
|
|
|
|
| Key | Function |
|
|
|
|
|---------+------------------------------------------|
|
|
|
|
| ~C-RET~ | ein:worksheet-execute-cell |
|
|
|
|
| ~S-RET~ | ein:worksheet-execute-cell-and-goto-next |
|
|
|
|
|
2015-07-27 19:50:52 +00:00
|
|
|
*** Traceback mode
|
|
|
|
In traceback mode the following key bindings are defined:
|
|
|
|
|
|
|
|
| key | Function |
|
|
|
|
|-------+----------------------------------------|
|
|
|
|
| ~RET~ | ein:tb-jump-to-source-at-point-command |
|
|
|
|
| ~n~ | ein:tb-next-item |
|
|
|
|
| ~p~ | ein:tb-prev-item |
|
|
|
|
| ~q~ | bury-buffer |
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
* Screenshots
|
|
|
|
** Light
|
2016-06-18 03:21:45 +00:00
|
|
|
#+attr_html: :width 400px
|
2015-06-10 16:44:30 +00:00
|
|
|
[[file:img/light.png]]
|
2016-04-13 03:31:38 +00:00
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
** Dark
|
2016-06-18 03:21:45 +00:00
|
|
|
#+attr_html: :width 400px
|
2015-06-10 16:44:30 +00:00
|
|
|
[[file:img/dark.png]]
|
2015-06-06 00:20:15 +00:00
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
* Bonus
|
2015-06-06 00:20:15 +00:00
|
|
|
If you want to have a matplotlibrc that looks good with a dark background try
|
2017-04-26 13:50:19 +00:00
|
|
|
using [[https://gist.github.com/anonymous/80219c49cb674d01e6b5fab94e759f54][this]] =matplotlibrc=. Plot background is always transparent by default so
|
2015-06-06 00:20:15 +00:00
|
|
|
it will look okay for most dark themes out there.
|