Nvim keeps taking my terminals transparency off - vim

I'm using the Windows Terminal thats available on the Microsoft Store (not the default), and I currently have acrylic and transparency on it. However everytime I open nvim, the colorscheme I have colors the background and the transparency goes away. I tried a couple solutions:
highlight Normal ctermbg=NONE
set t_Co=256
set termguicolors
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
colorscheme solarized8_flat
highlight Comment cterm=italic gui=italic
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
set t_ut=
endif
None of this works or changes anything, the window where the nvim background is not transparent.
Is there any way to solve this? Thanks.

Related

Changing Vim background color - and not text color

I was hoping to see if I could change the background color of Vim, so that when I'm insert mode my background changes slightly. (my default is dark grey, i'm hoping to change to light grey).
I was following some other SO posts I found, and tried
autocmd InsertEnter * hi Normal ctermbg=darkgrey
autocmd InsertEnter * hi Normal ctermbg=none
That was slightly working, since it would change my background, but it also changed my text color too - I just want the background changed.
I tried adding in ctermfg (foreground?)
autocmd InsertEnter * hi Normal ctermfg=none ctermbg=darkgrey
autocmd InsertEnter * hi Normal ctermfg=none ctermbg=none
Still did not fix it.
Pictures for reference:
When I open up vi - Default colors - which I like - Command mode
When I go into "insert" mode (background subtly changes (good!) text changes (not what I wanted)
Escaping out of insert, back to "Command" mode
I google'd some more, and found another SO post, that was explaining how the way ctermbg works, is it doesn't just change the background color, instead use
set background=
I tried that too:
autocmd InsertEnter * set background=dark
autocmd InsertLeave * set background=light
It changes the font color and background color, but this time when I go back to command mode the font color is back to normal (along with the background).
Is it possible, to just change the background color between 2 color (light grey and dark grey) without affecting text color, going from Insert Mode to Command Mode?
Is it possible, to just change the background color between 2 color
(light grey and dark grey) without affecting text color, going from
Insert Mode to Command Mode?
The answer is yes!
The trick consists in using GUI colors directly (like GVim) instead of terminal ones. Please try this:
Add set termguicolors before setting the colorscheme in your .vimrc
Add autocmd InsertEnter * hi Normal guibg=#4D4D4D
Add autocmd InsertLeave * hi Normal guibg=#333333
If your terminal is compatible and your Vim distribution is up-to-date, it should work.
If you like dark Vim colorschemes, you might be interested in Archery. I have shared the project on GitHub: https://github.com/Badacadabra/vim-archery

Colorscheme is not changing anything in vim

I'm typing :colorscheme desert or :colorscheme default or any other type of colorscheme in my vim, and I'm just getting the same one colorered text for my code with a black background. I would like the text in my files to have multiple colors to distinguish things but don't know how to do this
Perhaps you could provide your .vimrc and :version.
You may be missing any of these:
syntax on
set t_Co=256
filetype plugin indent on
You can check how the colorscheme is rendered via :hi. If all you see is black and white, Vim probably does not recognize your (color) terminal, and :set t_Co? will output 2 [colors]. Check your $TERM setting then.

How to set a transparent background for Vim with "true color" enabled?

I've enabled true colors for Vim with success using:
set t_8f=\[[38;2;%lu;%lu;%lum
set t_8b=\[[48;2;%lu;%lu;%lum
set termguicolors
(check :h xterm-true-color for more information)
I have then enabled a true color colorscheme to try the new setting, like:
set background=dark
colors deep-space
(https://github.com/tyrannicaltoucan/vim-deep-space)
Previously when using 256 colors I was able to get a transparent background by:
hi! Normal ctermbg=NONE guibg=NONE
hi! NonText ctermbg=NONE guibg=NONE
Now, this is not working anymore and I don't know any alternative. Is it possible to get transparent background with Vim under termguicolors?
UPDATE
I've opened an issue on Vim's issue tracker: https://github.com/vim/vim/issues/981

How can I change a part of colour scheme?

Here is my color scheme setting in .vimrc
" Use the Solarized Dark theme
set background=dark
" set background=light
colorscheme solarized
let g:solarized_termtrans=1
It looks like this in Terminal on OSX.
The problem with this scheme is that the cursor is invisible. How can make the cursor visible again?
Similarly in markdown files, for the currently selected line the color scheme is blue on black, which make it rather hard to read. How can i change this?
You can use the Cursor highlight group to recolor the cursor:
:highlight Cursor ctermfg={color} ctermbg={color} cterm={attributes}
To see what values can be placed in the {color} and {attributes} section, read this article in vim:
:help highlight-args

Make gvim 7.2 background black

I am sick and tired of the white background when I edit C/C++ etc. I want the black backround. That is what I currently have in my .vimrc file in regard to coloring. Please help me change it:
if !has('gui_running')
set t_Co=8 t_md=
highlight NORMAL ctermbg=black ctermfg=white
:help colorscheme
For example:
:colorscheme torte
Or, find a color scheme you like at vim.org.
Colors are controlled with the :highlight command Vim documentation: syntax , which allows you to specify colors for gvim (guifg and guibg) differently from colors for terminal vim (ctermfg and ctermbg).
All you have to do is make sure that the colors you assign to guifg and guibg are the same as you assign to ctermfg and ctermbg. Here's a script that might get you going: Xterm256 color names for console Vim
Depending on your colorscheme, the following command might work (it does depend on the colorscheme).
:set background=dark

Resources