luk400 / vim-jukit

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

Weird cells displays #39

Closed ls-devs closed 1 year ago

ls-devs commented 1 year ago

Hi, I just installed the plugin following the instructions but I got really strange cells display when creating them : Here's a "markdown cell" above a "code cell"

Screenshot from 2022-12-17 14-08-00

Also, I should maybe open another issue, but the package ueberzug is no longer maintained, so how do we need to deal with that if we want images to display in output ?

And also, plt dont show on output but are opened in new window (is there something I missed in config ?) : Screenshot from 2022-12-17 14-19-52

NVIM Version :

NVIM v0.9.0-dev-519+g2d8bbe468
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

OS :

Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy
luk400 commented 1 year ago

Hi! It looks like the highlighting options are not working/disabled for you. You didn't by chance change any of the default highlighting variables specified here, right? If not then some other setting/plugin in your config is disabling the markdown syntax highlighting and the cell marker signs. I'd suggest starting neovim with only vim-jukit enabled and an otherwise empty config, and then iteratively enabling the rest of your config to find out what's disabling the highlighting for you.

Regarding the matplotlib images: in-terminal plotting is only supported for kitty terminal, if you're already using kitty terminal please specify let g:jukit_terminal = "kitty" in your config, then it should work.

Überzug should work fine after specifying let g:jukit_hist_use_ueberzug = 1 in your config (see relevant options in readme).

Let me know if you still have any problems after those steps, as well as which setting/plugin was messing up the cell highlighting for you!

ls-devs commented 1 year ago

Hi, thanks for you quick reply.

You didn't by chance change any of the default highlighting variables specified here, right?

Of course, I didn't change any of the variables in the configuration.

I'd suggest starting neovim with only vim-jukit enabled and an otherwise empty config, and then iteratively enabling the rest of your config to find out what's disabling the highlighting for you.

Looks like my theme is somehow in conflict with the cells. After disabling all of my plugins and base config I end up with this : (the theme I use is catppuccin/nvim) Screenshot from 2022-12-18 12-28-04 But even with with no plugins except vim-jukit the markdown cells are not really working for me as you can see on screenshot. When creating a md cell, the first line start with a r""" and not with only quotes. You can see it's the same thing on the ouput window. Did I missed something like a plugin I need for vim-jukit to work ?

Regarding the matplotlib images: in-terminal plotting is only supported for kitty terminal, if you're already using kitty terminal please specify let g:jukit_terminal = "kitty" in your config, then it should work.

I misrided your documentation, sorry.

Überzug should work fine after specifying let g:jukit_hist_use_ueberzug = 1 in your config (see relevant options in readme). I mean, Uberzug have been removed from pip, as its not maintained anymore, my question was more, is there a way to install it anyway ?

I hope i'll make it works because your plugin is very awesome and I'll appreciate to work with it for my courses :)

luk400 commented 1 year ago

Looks like my theme is somehow in conflict with the cells. After disabling all of my plugins and base config I end up with this: (the theme I use is catppuccin/nvim)

The theme shouldn't be the problem, I just installed and enabled it and everything works as expected:

image

So it must be something else in your config that's the problem.

But even with with no plugins except vim-jukit the markdown cells are not really working for me as you can see on screenshot. When creating a md cell, the first line start with a r""" and not with only quotes. You can see it's the same thing on the ouput window.

The markdown cells seem to be working as expected in your screenshot, you can see that the vim markdown syntax highlighting is active inside the markdown cells (also see my screenshot). The content of markdown cells is wrapped in raw strings instead of regular strings since v1.3.4 to not raise warnings about unescaped special characters. Sending the markdown cell to the ipython shell doesn't do anything, that will just enter the raw string in ipython. If you want to actually render the markdown cells, you'll need to use Überzug (i.e. press <leader>so while inside the markdown cell and while having ueberzug enabled), see the readme.

In case you have any more questions regarding Überzug which are unclear after reading the readme, let me know

I hope i'll make it works because your plugin is very awesome and I'll appreciate to work with it for my courses :)

Thank you!

ls-devs commented 1 year ago

Can you tell me which Neovim version you are using ? I really think the problem comes from my theme because without disabling my plugins except my theme I can get vim-jukit to work as expected.

The markdown cells seem to be working as expected in your screenshot

So, if I follow you, this is the desired behavior. But what I see is that the only things I need to change in my config to make it works like this, is the theme.

If you want to actually render the markdown cells, you'll need to use Überzug

Überzug is not maintained anymore, and is not on pip too. So we can't just do a pip install uerberzug, how do we deal we that ? Shall we install it from source by finding on the ueberzug repository an ancient commit ?

Once again, thanks a lot for your quick replies.

luk400 commented 1 year ago

Can you tell me which Neovim version you are using ?

v0.7.0

So, if I follow you, this is the desired behavior. But what I see is that the only things I need to change in my config to make it works like this, is the theme.

Yes, have you checked if the problem also persists with other themes?

Überzug is not maintained anymore, and is not on pip too. So we can't just do a pip install uerberzug, how do we deal we that ? Shall we install it from source by finding on the ueberzug repository an ancient commit ?

Ah okay, I didn't know that it's not even available via pip anymore, thanks for making me aware of this! I'll have to see about a workaround for this problem sometime this week when I have time. But in the meantime, you could simply revert to the latest tag on the ueberzug github repo and see if you can install it from source. For reference, I have ueberzug version 18.1.9 installed and this still works great for me with this plugin

ls-devs commented 1 year ago

Seems to be the same with another theme see : Screenshot from 2022-12-18 22-46-52

I just remembered and forgot to tell that there's actually an issue with theming on Neovim since this merged PR neovim/pull/21100

Can it be related ? Maybe I should wait till neovim/pull/21373 is merged to see if there is still an issue with the cells display ?

Ah okay, I didn't know that it's not even available via pip anymore, thanks for making me aware of this! I'll have to see about a workaround for this problem sometime this week when I have time. But in the meantime, you could simply revert to the latest tag on the ueberzug github repo and see if you can install it from source. For reference, I have ueberzug version 18.1.9 installed and this still works great for me with this plugin

Ok thanks, I'll try to install it !

luk400 commented 1 year ago

I doubt it's related to that issue, I just tested again on NVIM v0.9.0-dev-530 and everything worked as expected. I used a completely empty config, and only included the following in my config.lua:

local packer = require("packer")
vim.cmd("colorscheme catppuccin")

return packer.startup(
    function()
        packer.use "luk400/vim-jukit"
        packer.use { "catppuccin/nvim", as = "catppuccin" }
    end
)

and everything works as expected. Does that still not work for you?

ls-devs commented 1 year ago

Hi, To be honest, it's now working. I'm not sure what was I missing. I installed Uerberzug, and updated nvim and now it's working properly. Please, see :

Screenshot from 2022-12-20 22-46-31

Sorry for waisting your time, thanks for your help. I'm gonna close the issue so, If I find out what was really happening, I'll paste the "solution" here.

luk400 commented 1 year ago

No worries, glad to hear it's working :)