nvim-ipy icon indicating copy to clipboard operation
nvim-ipy copied to clipboard

autoloading functions

Open farisachugthai opened this issue 6 years ago • 3 comments

Have you considered moving the functions into a file in an "autoload" dir and moving the syntax expressions into their own syntax file? Itd allow you to take advantage of the pre-existing python architecture in vim

farisachugthai avatar Sep 09 '19 19:09 farisachugthai

We can move the functions to "autoload" but I do not see what this has to do with "pre-existing python architecture" ?

bfredl avatar Sep 09 '19 20:09 bfredl

Oh sorry. I meant, in the sense of a syntax file, you could start with


if b:loaded_syntax
  finish
endif

runtime! syntax/python.vim  syntax/python/*.vim

So you get the added highlighting groups defined in the main python syntax files.

farisachugthai avatar Sep 10 '19 05:09 farisachugthai

But the plugin doesn't assume that the filetype is python, it works with jupyter kernel in any language. What is defined in the plugin is highlight groups, not syntax items.

You can use g:ipy_set_ft option to automatically set the filetype of the output buffer if you want.

bfredl avatar Sep 10 '19 09:09 bfredl