2

Is it possible to change the background color depending on which application is running currently?

My vim theme background differs with the terminal but I don't want to change the background of my terminal permanently just because of vim.

GhostOrder
  • 157
  • 1
  • 7

2 Answers2

0

You can use multiple configuration files for alacritty. So instead of the default alacritty.yml you pass a different configuration to it.

alacritty --config-file ~/.config/alacritty/alacritty-vim.yml -e vim

This would spawn one instance of alacritty, running vim inside it, using a dedicated configuration file just for your vim preferences. This would allow you to give it a different appearance just for vim.

But it won't use that configuration on the fly if you start vim in a terminal. That does not seem possible currently, although I guess that such a feature could be added to alacritty's IPC msg mechanism.

frostschutz
  • 47,228
  • 5
  • 112
  • 159
  • yeah, the issue is I always start vim from the terminal like `vim myfile.js` or `vim myprojectdir` – GhostOrder Jul 22 '22 at 16:44
  • you can still do that if you start alacritty with the vim specific configuration beforehand - or you could make an alias for vim which spawns a new terminal window for you. yeah, it's not perfect, but better than nothing at all... – frostschutz Jul 22 '22 at 17:08
0

For vim's colors there is vim's config, if that's what you are looking for. For example, I have

highlight Normal guibg=NONE

In ~/.config/nvim/init.vim, which makes vim's background transparent, i.e. matches it to alacritty's background. This works with transparency as well, if that's what you are after.