vimpyter


Ⅰ. 插件描述

Edit your Jupyter notebooks in Vim/Neovim

Ⅱ. 基本信息

创建日期:  2018-02-20
使用用户:  22
Github星:  261
插件作者:  Szymon Maszke

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'szymonmaszke/vimpyter-hard-things'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'szymonmaszke/vimpyter-hard-things'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'szymonmaszke/vimpyter-hard-things'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/szymonmaszke/vimpyter

Ⅳ. 文档说明

## Work on the next version began, post your feature ideas here

vimpyter

<p align="center">


</p>

  • Input/output cells are displayed using custom syntax file and folding.
  • See your edits by starting Jupyter Notebook/Nteract application with single command/mapping (just remember to save your modifications). You may have to reload browser page/app to see the effects.
  • To see other features click here

Demo

gif

Jupyter preview & more

Installation

Vim8 or Neovim is required (asynchronous features)

Install required external dependency:

Install plugin using plugin manager like vim-plug or Vundle:

Plug 'szymonmaszke/vimpyter' "vim-plug
Plugin 'szymonmaszke/vimpyter' "Vundle

If you want to use different plugin manager/direct instalation please do refer to their respective repositories/documentation.

Configuration

Plugin provides some convenience commands:

  • VimpyterStartJupyter: asynchronously starts jupyter notebook instance from Vim/Neovim
  • VimpyterStartNteract: asynchronously starts nteract instance from Vim/Neovim
  • VimpyterInsertPythonBlock: inserts block of python code (see Demo)

Example mappings (put this in your .vimrc/init.vim):

autocmd Filetype ipynb nmap <silent><Leader>b :VimpyterInsertPythonBlock<CR>
autocmd Filetype ipynb nmap <silent><Leader>j :VimpyterStartJupyter<CR>
autocmd Filetype ipynb nmap <silent><Leader>n :VimpyterStartNteract<CR>

To see all available flags/commands refer to vim's documentation

Options

Following options are provided:

  • g:vimpyter_color: display command line output in colour (0 or 1)
  • g:vimpyter_jupyter_notebook_flags: string describing flags passed to Jupyter notebook
  • g:vimpyter_nteract_flags: string describing flags passed to nteract app
  • g:vimpyter_view_directory: directory where proxy files are created (default: $TMP)

For detailed description type in your editor :help vimpyter-options

Integrations with other plugins

Currently supported plugins:

You can request additional integrations or create them on your own (pull requests are welcomed).

Contributors wanted!

Things you could do to improve this software:

Integrations with other plugins:

  • davidhalter/jedi-vim: Things like go to definition and documentation, maybe autocompletion (available as choice instead of deoplete-jedi).
  • w0rp/ale: Linting/fixing of .ipynb file. Using linters like flake8 from python or maybe custom made linter/fixer specifically for .ipynb file.

Other improvements:

  • Automatically update notebook on save: See this issue for more informations
  • Completion from ipython console: It may be faster to use this one. Check jonathanslenders/ptpython for possibilities.

Known bugs

If you find other bugs please post an issue. If you want to improve this software do not hesitate to cooperate!

添加新评论