Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neovim statusbar #74

Closed
ShiinaScripts opened this issue Feb 25, 2020 · 20 comments
Closed

Neovim statusbar #74

ShiinaScripts opened this issue Feb 25, 2020 · 20 comments

Comments

@ShiinaScripts
Copy link

ShiinaScripts commented Feb 25, 2020

Hi again !

Trying to start using neovim as text editor and it seems I've run into an issue.

image
I have copied your nvim config folder and sourced the statusline.vim, as far as I can see that already has lightline disabled so I'm not sure what it is.

Thanks once again ❤️

@elenapan
Copy link
Owner

Hmm, what terminal are you using? And is this neovim inside tmux?
It looks like the colorscheme is not loading properly.

@ShiinaScripts
Copy link
Author

I've tried konsole, gnome terminal and kitty, all of them have the same issue. I'm not using tmux either

And ya something with the colourscheme seems off

@elenapan
Copy link
Owner

elenapan commented Feb 28, 2020

Are you by any chance using the goyo plugin?

This happens to me whenever I exit goyo mode.
Probably related to this issue: junegunn/goyo.vim#160

In order to fix it I have to source statusline.vim again with
:source ~/.config/nvim/statusline.vim.

Edit: This should do it automatically:

function! s:goyo_leave()
  source ~/.config/nvim/statusline.vim
endfunction

augroup goyo_statusline_fix
    autocmd!
    autocmd! User GoyoLeave nested call <SID>goyo_leave()
augroup end

@ShiinaScripts
Copy link
Author

You're correct as always, sourcing it again fixes it!

I'm assuming I have to put the fix into init.vim ?

@elenapan
Copy link
Owner

elenapan commented Mar 1, 2020

I fixed the snippet above, now it works.

I'm assuming I have to put the fix into init.vim ?

Yes.

@ShiinaScripts
Copy link
Author

Even before you fixed the snippet it actually worked!

Thank you Elena :-)

@sunnyguan
Copy link

I am having the same issue with my setup but I don't have goyo plugin installed. By putting in the source ~/.config/nvim/statusline.vim line at the bottom of my init.vim, it was able to turn from basic vim statusline to yours but with the white blanks. I am using kitty but I have tried tmux and termite as well with the same results. Any thoughts?

Image

P.S. I am not exactly sure if it's good Github etiquette to post on a similar but closed issue so let me know if I should open a new one.

@elenapan
Copy link
Owner

elenapan commented Jun 4, 2020

Do you have set termguicolors in your config? If so, check out issue #85.

@sunnyguan
Copy link

I don't have that in either init.vim or statusline.vim.

@elenapan
Copy link
Owner

elenapan commented Jun 5, 2020

Could you try this and let me know if the statusline looks fine or not?

echo 'source ~/.config/nvim/statusline.vim' > /tmp/minimal-config.vim
nvim -u /tmp/minimal-config.vim

@sunnyguan
Copy link

Yep that's working fine, do you know how I can use that in init as well?

@sunnyguan
Copy link

sunnyguan commented Jun 5, 2020

I commented out "colorscheme lena" and it worked (but with the default color scheme instead). Any thoughts on why?

Update: I removed hi! clear from lena.vim in the colors folder and it's working fine now.

@elenapan
Copy link
Owner

elenapan commented Jun 6, 2020

It could be (?) that the colorscheme command is called asynchronously. Looks like even if it is used before loading the statusline, it can actually execute after it.

Weirdly enough, it does not happen with my current config, but I could reproduce this with a minimal config.

Anyway, thank you for posting the solution.

@ShiinaScripts
Copy link
Author

I'm having a similar issue again, but I'm running windows 10 with WSL 1 Ubuntu 18.04

It might be related to colourscheme I'm not sure

Image

I'm using windows terminal where the colour scheme definition is slightly different than xresources but I've tried my best

            "foreground": "#F8F8F2",
            "background": "#323F4E",
            "cursorColor": "#F8F8F2",
            "black": "#3D4C5F",
            "red": "#F48FB1",
            "green": "#A1EFD3",
            "yellow": "#F1FA8C",
            "blue": "#92B6F4",
            "purple": "#BD99FF",
            "cyan": "#87DFEB",
            "white": "#F8F8F2",
            "brightBlack": "#56687E",
            "brightRed": "#EE4F84",
            "brightGreen": "#53E2AE",
            "brightYellow": "#F1FF52",
            "brightBlue": "#6498EF",
            "brightPurple": "#985EFF",
            "brightCyan": "#24D1E7",
            "brightWhite": "#E5E5E5"

@elenapan
Copy link
Owner

elenapan commented Jun 7, 2020

The colorscheme definition looks good to me.

  • Does it look fine other terminals?
  • Does it look fine if you do not use colorscheme lena inside your neovim config?

Sadly I cannot test with Windows terminal, so could you try this and let me know if it works?

set term=xterm
set t_Co=16

@ShiinaScripts
Copy link
Author

I have a couple other terminals that I can try, but none of them seem to be able to display it properly. In the other terminals I have, hyper, and fluent terminal the mouse supports seems to be not working while in windows terminal it works fine. I'm not sure if the issue is just related to windows but maybe.

I'll try and get kitty running some time in the future.

set term=xterm was not a recognized command
set t_Co=16 didn't seem to do anything

Without the colorscheme lena it only changes the colours so I don't think that does anything to make the symbols appear

@elenapan
Copy link
Owner

elenapan commented Jun 8, 2020

I suspect that the Windows terminal does not render the black color correctly when it is used as a background color and displays the background color instead.

Looking at this screenshot of the dracula theme for Windows terminal (which has different colors for black and background), the same thing happens on the first line of the output.

Could you try putting this possible fix in your config? (From microsoft/terminal#832 (comment))

if (&term =~ '^xterm' && &t_Co == 256)
  set t_ut= | set ttyscroll=1
endif

Also let me know how it goes whenever you install kitty.

@ShiinaScripts
Copy link
Author

I've put it into init.vim and now the corners are actually displaying correctly but not the middle

image

@ShiinaScripts
Copy link
Author

An update on this, I never got kitty installed but I have tried alacritty and the same issue appears. I'm starting to think windows needs some more special treatment

@elenapan
Copy link
Owner

Indeed.

One possible solution could be to generate a true-color vim colorscheme and use that instead of lena.vim.

The only downside would be that if you change the colorscheme of your Windows terminal, the vim colorscheme will not follow, and will need to be regenerated in order to match.

If Windows terminal supports true-color, and you are OK with this solution, we could give it a shot.

This command can determine if the terminal supports true-color:

awk 'BEGIN{
    s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
    for (colnum = 0; colnum<77; colnum++) {
        r = 255-(colnum*255/76);
        g = (colnum*510/76);
        b = (colnum*255/76);
        if (g>255) g = 510-g;
        printf "\033[48;2;%d;%d;%dm", r,g,b;
        printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
        printf "%s\033[0m", substr(s,colnum+1,1);
    }
    printf "\n";
}'

If it prints a smooth rainbow gradient like this, then it supports true color:

image

Let me know if you would like me to generate the colorscheme so we can try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants