pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ivanov/ipython-vimception

crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-b48faa60c69660fa.css" /> GitHub - ivanov/ipython-vimception: Vim-within-Vim in the IPython Notebook. · GitHub
Skip to content

ivanov/ipython-vimception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IPython Vimception

Vim-within-Vim in the IPython Notebook.

In my "Putting the V in IPython" talk at SciPy2014, I spent half of my time talking about ipython-vimception. Here are the slides for the talk.

This is a work in progress. For now, put these files into a folder called vimception (not ipython-vimception) in 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 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:

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');
    if (!IPython.notebook.kernel) {
        $([IPython.events]).on('status_started.Kernel', function() {
            cell.execute();
            IPython.notebook.delete_cell();
        });
    } else { 
        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>',
            ].join("\n"));

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

This allows you to enter vimception by going clicking on Help -> vimception . 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

[ ] suppress switching into command mode when moving cursor past the top/bottom lines (using new methods Jonathan added)

[ ] make the multi-level escaping optional (i.e. allow only ctrl-m to take you to command mode)

[ ] look up what else I had in my todo a few weeks ago

[ ] add logic to %vimception to write vimception.json to profile_dir/static/custom - investigate json config in general (Matthias implemented this at some point)

[ ] multi-level undo

[ ] unalias v - and use nb-cccp if it's loaded

[ ] turn it into an nbextension (no python side) - implementing this should close #4 as well

[ ] Ctrl-n and Ctrl-p should work as local completion (like in vim)

[ ] on click, disable the vim fire

[ ] the cell that vimception is started from gets FUBARed :\ or actuall just entering edit mode doesn't work?

[ ] allow going between cells independent of which character you're on

[ ] shift-J on the last line should join cell below

[ ] standardize on a post-load function that vimception will call to allow for further customization.

[ ] look into the codemirror changes here

Related Projects

vim-ipython - A two-way integration between Vim and IPython by the same author.

About

Vim-within-Vim in the IPython Notebook.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy