Skip to content

yangye1098/vim-ipynb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-jupyter

vim plugin for viewing, editting jupyter notebook, running code cells and converting to markdown, pdf.

Requirement

  1. vim with python3 integrated
  2. vim-pandoc and vim-pandoc-syntax plugin for converting .ipynb files and grammar support

Features

  1. Open and files with corresponding backend kernel and convert it into markdown-like text.
  2. Different kernels support (python and matlab for now).
  3. Syntax highlighting support through vim-pandoc-syntax.
  4. Create markdown and code cells.
  5. Run codes in code cells.
  6. Convert .ipynb files into pandoc, markdown, html, pdf, or corresponding script files

Syntax

Markdown cell

#%%<MardownCellName>

Code cell

```<KernelLanguage> <CellName>
some codes
```

Usage

New .ipynb files

After creating a new .ipynb file, a kernel must be explicitly started using

:StartKernel <kernelname>

Kernel Related Commands

:StartKernel <kernelname> Start a kernel
:ConnectToKernel <jsonfile> Connect to an existing kernel specified by <jsonfile>
:ConnectToPreviousKernel Connect to a most recented created kernel 
:KernelShutdown Shutdown current kernel
:KernelRestart Restart current kernel 

Run Code Cells

For running current code cell command, code can only be run when cursor is inside a code cell.

<space>  Run current line 
<localleader>a Abort Run line buffer
<localleader>cc Run current cell 
<localleader>cd Run current cell and go to nex cell
<localleader>cn <n> Run number n cell
<localleader>r Run all code cells

Other Commands

<localleader>p: print variable under cursor
<localleader>pn <var>: print variable <var>
<localleader>h: get help under cursor
<localleader>hn <name>: get help for <name>

Convert Filetype Commands

:ToPandoc 
:ToHtml
:ToMd
:ToPdf
:ToCode

Output related Commands

:ClearAll Clear all output from code cells.

Configuration Option

Open ipynb as raw ipynb json format

let g:ipynb_convert_on_start=0

Comment

This is a primary plugin and still under developing. Basic functionalities are working with potential bugs.

About

vim plugin for runing jupyter notebook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published