TaDaa / vimade

An eye friendly plugin that fades your inactive buffers and preserves your syntax highlighting!
MIT License
495 stars 9 forks source link

vimade doesn't seem to be doing anything in terminal mode #1

Open yunake opened 5 years ago

yunake commented 5 years ago

Great plugin! I've installed using native vim rtp loading and it seems to be working fine in GUI, but it isn't doing anything in terminal mode. How can i efficiently debug this issue? I'm using Tango palette in gnome-terminal and tilda, inside and outside of tmux, and 256 color support is working just fine, even true color in the apps that support it.

TaDaa commented 5 years ago

Terminal is still a wip, currently it only supports the xterm 256 palette, but I can take a look as soon as I get some free time to see about adding gnome + tilda. Which colorscheme are you using?

ryan-ph commented 5 years ago

I'm experiencing the same on Alacritty and Tmux. I'm using quantum

Ch00k commented 5 years ago

Second that. tmux + alacritty + base16 color schemes (both bash and vim).

lervag commented 5 years ago

I use a solarized palette in urxvt.

ryan-ph commented 5 years ago

It seems to work on Alacritty if you set termguicolors, but if possible, it would be nice to have it function without termguicolors being set.

yunake commented 5 years ago

i'm on a slightly customised lucius colorscheme. didn't realize it would matter.

TaDaa commented 5 years ago

pushed a fix where the normalid couldn't be resolved in some terminals, see if this resolves the issues for you guys

daf commented 5 years ago

Working for me in gnome-terminal. The first time I exited there was an error printed on the terminal from vimade, some python problem, but trying to replicate it, I can't get it to come back again. I'll keep an eye out.

Works in tmux too!

daf commented 5 years ago

Happened again but I can't reproduce it faithfully at all:

~ -> vim ~/tmp/dumpff.py 
Error detected while processing function vimade#CheckWindows[5]..provider#python3#Call:
line   18:
Invalid channel: 2~ ->

shows up on exit. Probably 1 in 15 exits will have this shown.

TaDaa commented 5 years ago

always a complaint on line 18?

Also you on vim or neovim? I do see some similar errors floating around on neovim, issues with python threading or something -- but I'll have to get neovim setup later on my VM to debug

Ch00k commented 5 years ago

see if this resolves the issues for you guys

no difference in my case, unfortunately :(

daf commented 5 years ago

@TaDaa yes, line 18, and I'm on neovim.

TaDaa commented 5 years ago

@Ch00k sorry about that -- its taking me some time to setup alacritty (only have it working on mac atm) -- which OS are you using alacritty on? -- Also what is your output for "echo &t_Co" and "echo g:vimade"?

Ch00k commented 5 years ago

@TaDaa I use macOS 10.13.6. I just tried to run vim inside and outside of tmux, and both the echo's produce the same result:

256
{'basebg': '', 'basefg': '', 'fadelevel': 0.4, 'rowbufsize': 30, 'colbufsize': 30, 'normalid': 84, 'checkinterval': 32}
TaDaa commented 5 years ago

Running 10.14.1, works in alacritty + tmux 2.8 for me (unless I set termguicolors, that seems to break syntax highlighting in general). Does your :messages contain errors? Is syntax highlighting normally? Does vimade work in Alacritty by itself, if not does it work in the default terminal?

TaDaa commented 5 years ago

You may see some change now! For terminal there was a possibility that ctermfg/ctermbg does not get set (when it uses the terminal defaults). There isn't a 100% way of getting the terminal settings (and tmux n, but Vimade should at least try now and default to 0/248 if it can't.

I think for best results on Alacritty, vimade needs a colorscheme that specifies Normal or vimade needs to be configured using g:vimade.basebg and g:vimade.basefg. I could not find a way to make Alacritty print out the colors like other xterm terminals could (so if any of you know how, let me know -- I may ask on their github later if not)

TaDaa commented 5 years ago

Spoke too soon, almost there

typoman commented 5 years ago

I can confirm the plugin works for native OSX (10.13.6) terminal app (xterm-256color).

Ch00k commented 5 years ago

The latest code works for me in tmux with vim base16 colorscheme. Although vim startup is pretty slow now, and :messages still shows this:

Vimade: could not load terminal ansi colors, trying tmux...
Vimade: could not load tmux colors, make sure you either use a colorscheme that defines a background and foreground for 'Normal' or configure g:vimade.basefg and g:vimade.basebg

I have no custom vimade variables defined in my vimrc.

perklet commented 5 years ago

The latest code works for me in tmux with vim base16 colorscheme. Although vim startup is pretty slow now, and :messages still shows this:

Vimade: could not load terminal ansi colors, trying tmux...
Vimade: could not load tmux colors, make sure you either use a colorscheme that defines a background and foreground for 'Normal' or configure g:vimade.basefg and g:vimade.basebg

I have no custom vimade variables defined in my vimrc.

Same Issue here

TaDaa commented 5 years ago

Slowness should be fixed now guys and messages should be gone -- the terminal support should overall be a better experience I am hoping...

Here is what is supported: autodetection of terminal background and foreground colors for vim8 tilix, kitty, gnome, rxvt, and any other terminal that can correctly return the background/foreground ansi requests. Tmux is also supported on the previously mentioned terminals (tmux depends on the terminal and then wraps the response in its own request code).

Neovim is not supported for autodetection of background/foreground yet. Instead vimade will default the fades based on white/black or vice versa depending on whether &background is light or dark...I am working on supporting autodetection on neovim and have a partially working hack but it requires hijacking the UI tty (since neovim is actually not the tty). I am a bit hesitant to put the hack in because its a bit fragile, but it might lead me to a better solution soon.

TaDaa commented 5 years ago

Couple of Alacritty users here, so I opened an issue on Alacritty git regarding the ANSI codes not working, maybe they have an alternative https://github.com/jwilm/alacritty/issues/2039

ChrisAmelia commented 5 years ago

NVIM v0.4.0-762-g9420a2127 (AppImage), gnome-terminal

After having installed vimade with Vim-Plug: Plug 'TaDaa/vimade', it looks like vimade hasn't been added correctly, command VimadeEnable is not recognized (same for others commands). Any ideas?

benfrain commented 4 years ago

Neovim v0.4.3 and Nord theme, using iTerm2 v3.3.9.

I'm a front-end dev so entirely possible I'm doing something stupid but very little seems to change between panes. Attaching a grab whereby the top pane is active — notice that only some characters get dimmed/re-colored and line-numbers are unaffected. This is using this config for vimmade:

let g:vimade = {}
let g:vimade.fadelevel = 0.4
let g:vimade.enablesigns = 1
Screenshot 2020-04-06 at 18 18 25
TaDaa commented 4 years ago

May need a minimal vimrc/init.vim and I'll try to reproduce the issue.

Also are you using tmux and is nvim using termguicolors or is it in 256 color mode?

benfrain commented 4 years ago

@TaDaa Hi! no tmux, my init.vim is here - that was saved up just before adding vimade as per earlier comment.

Here is the bit in the init.vim regarding colours:

if exists('+termguicolors') && ($TERM == "st-256color" || $TERM == "tmux-256color")
    let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
    let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
    set termguicolors
endif
TaDaa commented 4 years ago

Thanks @benfrain

Few questions:

benfrain commented 4 years ago

Thanks @benfrain

Few questions:

  • Can you confirm the output of echo $TERM?

=> xterm-256color

  • What is the output of echo &termguicolors

=> 0

BTW - I have noticed that if I open a split with :sp the new pane doesn't get highlighted. If I open my 'init.vim' file with my shortcut nnoremap <Leader>v :vsp $MYVIMRC<CR> that does make the other panes fade.

Is that because the :sp is opening the same file rather than a different one, so it doesn't know to dim it??

TaDaa commented 4 years ago

That is right, :sp and :sp won't dim because its the same buffer (until the buffer changes via buffer switch, new, etc)

The partial highlighting is still strange to me, I have not been able to reproduce the issue, but we are also seeing different results in 256color mode (my background shows as black and not the nord theme).

It is possible that in 256color the approximation for the fade somehow calculated too close to the Normal ctermfg, which would result in the same color text. Might be worth trying to adjust the fadelevel to 0.3 or 0.2 and see if the text changes color at all. I will say termguicolors produces much better results if its an option for you.