Tsuzat / NeoSolarized.nvim

NeoSolarized colorscheme for NeoVim with full transparency
Apache License 2.0
174 stars 16 forks source link

Cannot disable italics #23

Closed shahank42 closed 4 months ago

shahank42 commented 4 months ago

Although things like dark style and transparent background reflect, I am not able to disable the italics.

Here's my config (using lazy.nvim):

  {
    'Tsuzat/NeoSolarized.nvim',
    lazy = false,
    priority = 1000,
    style = 'dark',
    transparent = true,
    enable_italics = false,
    config = function()
      vim.cmd [[ colorscheme NeoSolarized ]]
    end,
  },
Tsuzat commented 4 months ago

It would have been better if you could have provided some screenshots. Anyways, The style and transparent is working because these are default options and the way you have tried to configure them, does not make any effect. You actually need to call setup,

try using

{
  "Tsuzat/NeoSolarized.nvim",
    lazy = false, -- make sure we load this during startup if it is your main colorscheme
    priority = 1000, -- make sure to load this before all the other start plugins
    config = function()
      local ok_status, NeoSolarized = pcall(require, "NeoSolarized")

      if not ok_status then
        return
      end

      -- Default Setting for NeoSolarized

      NeoSolarized.setup {
        style = "dark", -- "dark" or "light"
        transparent = true, -- true/false; Enable this to disable setting the background color
        terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
        enable_italics = true, -- Italics for different hightlight groups (eg. Statement, Condition, Comment, Include, etc.)
        styles = {
          -- Style to be applied to different syntax groups
          comments = { italic = true },
          keywords = { italic = true },
          functions = { bold = true },
          variables = {},
          string = { italic = true },
          underline = true, -- true/false; for global underline
          undercurl = true, -- true/false; for global undercurl
        },
        -- Add specific hightlight groups
        on_highlights = function(highlights, colors) 
          -- highlights.Include.fg = colors.red -- Using `red` foreground for Includes
        end, 
      }
      -- Set colorscheme to NeoSolarized
      vim.cmd [[ colorscheme NeoSolarized ]]
    end
}

Change the config in setup as you please.

If you are not changing anything elese, but italics, you do not need to put everything in the setup.

In fact this should be fine,

{
  "Tsuzat/NeoSolarized.nvim",
    lazy = false, -- make sure we load this during startup if it is your main colorscheme
    priority = 1000, -- make sure to load this before all the other start plugins
    config = function()
      require("NeoSolarized").setup {
        enable_italics = false,
      }
      vim.cmd [[ colorscheme NeoSolarized ]]
    end
}
shahank42 commented 4 months ago

Yay no more italics! Thanks a lot :-)

Tsuzat commented 4 months ago

Happy Coding :)