-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Force nvim to use 16 colors #11974
Comments
Some missing info above, though I don't think it'll be super relevant here:
|
Then changing ANSI "red" to some other color in your terminal, will color comments as such. Note that this requires The
Is |
Thanks for the info. You tagged this issue as a duplicate, but I wasn't able to find anything that is really the same ("force downscaling to 16 colors") on a quick search. I do see #5538 and #11883 which also discuss I will test this further and report back, including setting a 16-color scheme such as https://github.com/noahfrederick/vim-noctu or https://github.com/jeffkreeftmeijer/vim-dim, and trying to reproduce the segfault in the latest development version. |
Set s:t_Co in a way that pleases more Neovim when Neovim support is required. Neovim has deprecated all `t_xx` options including `t_Co`, which is currently read-only (but could potentially be removed). According to Neovim's developers, if a user wants to force the use of 16 colors even in terminal that supports more colors, it's the colorscheme that must do so. See in particular this comment: neovim/neovim#11974 (comment) So, this PR defines `s:t_Co` prioritizing the existence of a colorscheme specific variable call `g:<prefix>_t_Co` or of a global `g:t_Co` setting, falling back to checking whether `t_Co` exists otherwise.
@nylen you can emulate t_Co with |
I'd like to force
nvim
to use only the basic 16 ANSI colors, regardless of what it detects in theTERM
orCOLORTERM
environment variables or wherever else it is looking. The reason is that I plan to use the same config on multiple machines, including various combinations of tmux, SSH, etc, and I will configure the actual color values in my terminal emulator.The following code is the only place
t_colors
is set that I can see, and I can't find a way to override it:neovim/src/nvim/tui/tui.c
Lines 292 to 293 in 96059d7
In
vim
you can do this using:set t_Co=16
But in
nvim
this seems to have no effect (or crashes, see below).I've also tried
TERM= COLORTERM= nvim
which doesn't change anything, nvim is still using 256 colors.I can actually get a segfault by playing with this also, here are the steps:
nvim
:set t_Co=16
fg
to resumeSegmentation fault
(without Step 2 this does not happen).The text was updated successfully, but these errors were encountered: