Skip to content

Commit

Permalink
updated instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanov committed Mar 7, 2014
1 parent 55795f1 commit 68f4240
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,43 @@ This is a work in progress. For now, put these files into the `extensions`
subdirectory of whatever `ipython locate` returns, usually these files go into
the `~/.ipython/extensions` directory.

Once you do that, in the notebook, just make a cell that will do
Once you do that, in the notebook, just make an execute a cell with:

%load_ext vimception

Once you're satisfied that the above works, you can edit your profile's
static/custom/custom.js to have this:

```javascript
function load_vimception() {
cell = IPython.notebook.insert_cell_at_index('code', 0);
IPython.notebook.select(0);
cell.set_text('%load_ext vimception\n%reload_ext vimception\n%vimception');
$([IPython.events]).on('status_started.Kernel', function() {
cell.execute();
IPython.notebook.delete_cell();
});
}

$([IPython.events]).on('notebook_loaded.Notebook', function(){
$('#help_menu').prepend([
'<li id="vimception" title="load up vimception cell">',
'<a href="#" title="vimception" onClick="load_vimception()">vimception</a></li>',
'<li id="reflow" title="reflow markdown text">',
'<a href="#" title="vimception" onClick="reflow_markdown()">reflow text</a></li>',
].join("\n"));

// uncomment next line to *always* start in vimception
// $('#vimception a').click();
});
```

This allows you to enter vimception by going clicking on <code>Help ->
vimception </code>. To leave vimception, save and reload the notebook. If you
uncomment the last line to *always* start vimception, there will not be a way to
get out of vimception mode without editing custom.js and then reload the page.


It's all very rough right now, I'm working on it, so hang tight.

TODO
Expand Down

0 comments on commit 68f4240

Please sign in to comment.