daa84 / neovim-gtk

gtk ui for neovim
GNU General Public License v3.0
716 stars 57 forks source link

Feature request: ability to use ctermfg/ctermbg instead of guifg/guibg for colorschemes #190

Closed unclechu closed 5 years ago

unclechu commented 5 years ago

Add an ability to force using ctermfg/ctermbg colors instead of guifg/guibg. To kinda act as TUI in context of rendering colors.

I have some old colorschemes which look a lot better in TUI than in neovim-gtk GUI, I'd like to use neovim-gtk but be able to make neovim-gtk render such colorschemes as TUI does.

This option could be set via rpcnotify for example.

I've been asking about this in this main neovim's chat: #neovim:matrix.org and I've been told by Justin M. Keyes:

see :help ui-options. The GUI can set ext_termcolors on attach, then ctermfg/ctermbg are used instead of guifg/guibg.

You probably will need to patch the GUI or make a feature-request, since this is not a popular request. It's trivial for any GUI to support this, but probably most of them don't know about it.

daa84 commented 5 years ago

call rpcnotify(1, 'Gui', 'Option', 'Cmdline', 1) can you check it in termcolors branch?

justinmk commented 5 years ago

do you mean:

call rpcnotify(1, 'Gui', 'Option', 'Termcolors', 1)
daa84 commented 5 years ago

ups, yes Termcolors call rpcnotify(1, 'Gui', 'Option', 'Termcolors', 1)

unclechu commented 5 years ago

@daa84 It seems it doesn't affect anything. I'm trying it with solarized8 colorscheme. I was trying to set that option after I start neovim-gtk and also in init.vim/ginit.vim before switching colorscheme.

Commit hash: 2b8149ba54afb6fc39021ea65a76f2c1d49b4c3e

justinmk commented 5 years ago

Why not just check it yourself with a simple highlight command.

hi Normal ctermfg=red guifg=green
daa84 commented 5 years ago

I'll check, Maybe that this option works only on attach and not after...

daa84 commented 5 years ago
  1. this option supports only on nvim 0.4
  2. also look like it works only with new multi grid api

Think time to merge branch newgrid to master then apply this changes to it

unclechu commented 5 years ago

But nvim 0.4.0 isn't exists yet, it's in development and isn't released yet. It could take months.

daa84 commented 5 years ago

new branch termcolors_opt, option --cterm-colors must solve problem also on old version without option ext_termcolors please check

unclechu commented 5 years ago

@daa84 It's working!

unclechu commented 5 years ago

@daa84 Will it be merged to master branch soon?

daa84 commented 5 years ago

merged