marko-cerovac / material.nvim

:trident: Material colorscheme for NeoVim written in Lua with built-in support for native LSP, TreeSitter and many more plugins
GNU General Public License v2.0
993 stars 129 forks source link

contrast.filetypes not working for toggleterm #145

Closed anurag3301 closed 1 year ago

anurag3301 commented 1 year ago

Hey I use this toggleterm.nvim plugin for my terminal emulator in neovim. I want the toggleterm window to be darker in contrast, so I added the following configuration

    contrast = {
        terminal = false,
        sidebars = true,
        floating_windows = true,
        cursor_line = false,
        non_current_windows = false,
        filetypes = {
            'terminal',
            'packer',
            'qf',
            'toggleterm'
        },
    },

I have added the toggleterm as filetype but its not working. image If there is any mistake in my config, please let me know how should I fix this.

anurag3301 commented 1 year ago

This is my config

-- Material Theme config
vim.g.material_style = 'deep ocean'

require('material').setup({

    contrast = {
        terminal = false,
        sidebars = true,
        floating_windows = true,
        cursor_line = false,
        non_current_windows = false,
        filetypes = {
            'terminal',
            'packer',
            'qf',
            'toggleterm'
        },
    },

    styles = {
        comments = { italic = true },
        strings = {},
        keywords = {},
        functions = { italic = true },
        variables = {},
        operators = {},
        types = { bold = true },
    },

    plugins = {
        -- "dap",
        "dashboard",
        "gitsigns",
        "hop",
        -- "indent-blankline",
        -- "lspsaga",
        -- "mini",
        -- "neogit",
        "nvim-cmp",
        -- "nvim-navic",
        "nvim-tree",
        -- "sneak",
        "telescope",
        -- "trouble",
        -- "which-key",
    },

    disable = {
        colored_cursor = false,
        borders = false,
        background = false,
        term_colors = false,
        eob_lines = false
    },

    high_visibility = {
        lighter = false,
        darker = false
    },

    lualine_style = "default",

    async_loading = true,

    custom_colors = nil,

    custom_highlights = {},
})

vim.cmd 'colorscheme material'

vim.cmd("highlight WinSeparator guifg=#c0bfbc")
marko-cerovac commented 1 year ago

What is the output when you run the command :set filetype in toggleterm?

anurag3301 commented 1 year ago

Its filetype=toggleterm

anurag3301 commented 1 year ago

The bufferline.nvim plugin shows the same thing image

marko-cerovac commented 1 year ago

Toggleterm uses it's own highlight system. You need to set the background to NormalContrast in your toggleterm settings if you want it to have a darker background.

require("toggleterm").setup({
    highlights = {
        Normal = {
            guibg = "NormalContrast"
        }
    }
})
anurag3301 commented 1 year ago

Hey I tried adding this in my toggleterm config but it didn't work

  highlights = {
    Normal = {
       guibg = "#090b10"
    }
  }

Should I create an issue in toggleterm and mention this issue over there?

anurag3301 commented 1 year ago

Okay my bad, just revised my config and this line was causing the problem

   shading_factor = 1,

I removed it and its working image Thanks for you help :)

marko-cerovac commented 1 year ago

guibg doesn't take a color as an argument, it takes a different highlight group to link to. Instead of #090b10, just put NormalContrast.

anurag3301 commented 1 year ago

Oh okay, I changed it to NormalContrast, Thank you :)