luk400 / vim-jukit

Jupyter-Notebook inspired Neovim/Vim Plugin
MIT License
587 stars 23 forks source link

How to enable a plugin only for ipynb files in vimrc? #73

Closed Mingzefei closed 1 year ago

Mingzefei commented 1 year ago

I'm trying to set up my vimrc so that this wonderful plugin is only loaded or its commands are only executed when opening *.ipynb files. For example, using <Enter> to execute code cells in ipynb files is very convenient, but it causes unnecessary errors and keybinding conflicts when working with other file types. Is there a way to control the overall switch of this plugin?

System: WSL2 Ubuntu 20.04 Software: neovim 0.7.2

luk400 commented 1 year ago

Hello! Yes, you can set e.g. let g:jukit_mappings_ext_enabled = ["py", "ipynb"] in your config (before the plugin is loaded) to only enable the mappings for .py and .ipynb files, see the relevant section in the readme.

Mingzefei commented 1 year ago

Thank you! This did the trick. I actually missed that in the readme.