Vim notebook, mimicking IPython notebooks
Make sure the files pywrap.py and vimnb are executable.
Make sure vimnb is in your path.
Edit vimnb so that the variable FILEDIR points to the location of
all other files.
Call vimnb on your favourite python script, and execute parts of the code by
selecting them, and hitting <Space>. Watch the magic happen.
VimNB has a notion of codeblocks. It are pieces of Python code delimited by
#{{{ and #}}}. To create a codeblock, hit <Ctrl-N>b.
<Ctrl-N>bto create a codeblock.<Ctrl-N>rto run a codeblock.<Ctrl-N>eto run a codeblock, and jump to the next.<Ctrl-N>sto split a codeblock.- Use
[b(resp.]b) to jump to the start of the previous (resp. next) codeblock. - Use
[B(resp.]B) to jump to the start of the end (resp. next) codeblock. - There are vim textobjects:
aboperates on an entire codeblockiboperates on the code in a codeblockiooperates on the output of a codeblock For example:diodeletes the output (make sure the cursor is on the output) In the same spirit,cibchanges the code of the codeblock,vabselects the entire codeblock, andzfiofolds the output.