ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

IPython Notebook

by maximsch2 ST2/ST3

IPython Notebook plugin for Sublime Text 3/2

Details

  • 2 2013.10.06.18.25.13
    3 1.0.1
  • github.​com
  • github.​com
  • 1 year ago
  • 59 minutes ago
  • 2 years ago

Installs

  • Total 6K
  • Win 2K
  • OS X 2K
  • Linux 2K
Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20
Windows 3 4 2 2 4 5 3 4 7 5 3 5 4 2 5 5 1 2 6 2 1 2 6 5 4 4 4 4 0 2 12 9 4 5 4 0 3 3 7 2 4 5 3 3 3 6
OS X 1 4 7 4 5 2 5 2 3 4 1 2 3 4 4 6 3 4 6 2 4 3 1 2 3 2 2 0 1 7 5 7 7 5 1 1 4 6 7 3 1 7 2 3 0 5
Linux 0 1 4 3 3 2 2 1 0 3 3 4 2 3 3 7 0 5 1 1 5 1 2 4 3 3 3 1 1 4 6 2 7 5 5 5 2 2 1 5 3 2 2 1 4 5

Readme

Source
raw.​githubusercontent.​com

Sublime IPython Notebook

This is a Sublime Text 3 plugin that emulates IPython notebook interface inside Sublime.

Disclaimer

While the plugin looks stable so far and I am trying to preserve as much of the notebook data as possible, there are no guarantees that you data will be safe. Do not use it for the notebooks that contain valuable data without doing a backup.

How to use

  1. Connect to the notebook server using “Open IPython Notebook” command. Choose a notebook you want to open and it will open in a separate buffer.
  2. I am trying to support keyboard shortcuts from the web version of the notebook. Currently you can use:
    • shift+enter - execute current cell
    • ctrl+enter - execute current cell inplace
    • ctrl+m, d - delete current cell
    • ctrl+m, a - add cell above current
    • ctrl+m, b - add cell below current
    • ctrl+m, n - select next cell
    • ctlr+m, p - select previous cell
    • ctrl+m, y - code cell
    • ctrl+m, m - markdown cell
    • ctrl+m, t - raw cell
    • ctrl+m, s - save notebook (ctrl+s and super+s will work too)

Notes

  1. You can use %pylab inline. You will not be able to see the plots, but they will be saved in the notebook and available when viewing it through the web interface.
  2. I am using websocket-client library from https://github.com/liris/websocket-client and (slightly patched) subset of the IPython. You do not have to install them separately.
  3. ST3 port was contributed by chirswl
  4. Dark theme, support for password-protected servers and nicer last-used-server picker was contributed by z-m-k

Vintage Mode

In Vintage mode, for the navigation keys to work as expected in IPython Notebook buffer, you need to modify some keybindings. Add the following to your Key Bindings - User.

  1. Add a context key to Shift+Enter so you can run a cell with Shift+Enter in the command mode:

    { "keys": ["shift+enter"], "command": "set_motion", "args": {
        "motion": "move",
        "motion_args": {"by": "lines", "forward": true, "extend": true }},
        "context": [
            { "key": "setting.command_mode"},
            { "key": "setting.ipython_notebook", "operator": "equal", "operand": false },
            ]
    },
    
  2. Command mode Up/Down navigation keys:

    { "keys": ["j"], "command": "set_motion", "args": {
        "motion": "move",
        "motion_args": {"by": "lines", "forward": true, "extend": true },
        "linewise": true },
        "context": [
            { "key": "setting.command_mode"},
            { "key": "setting.ipython_notebook", "operator": "equal", "operand": false },
            ]
    },
    
    {
        "keys": ["j"], "command": "inb_move_up",
        "context" : [
            { "key": "setting.command_mode"}
            { "key": "setting.ipython_notebook", "operator": "equal", "operand": true },
            { "key": "auto_complete_visible", "operator": "equal", "operand": false },
            ]
    },
    
    { "keys": ["k"], "command": "set_motion", "args": {
        "motion": "move",
        "motion_args": {"by": "lines", "forward": false, "extend": true },
        "linewise": true },
        "context": [
            { "key": "setting.command_mode"},
            { "key": "setting.ipython_notebook", "operator": "equal", "operand": false },
            ]
    },
    
    {
        "keys": ["k"], "command": "inb_move_down",
        "context" : [
            { "key": "setting.command_mode"},
            { "key": "setting.ipython_notebook", "operator": "equal", "operand": true },
            { "key": "auto_complete_visible", "operator": "equal", "operand": false },
            ]
    },