Solarized is a sixteen color palette (eight monotones, eight accent colors) designed for use with terminal and gui applications. Solarized port for Neovim
Go to file
Max Miliano 10eb62fe0f
Some checks are pending
Test / lint (push) Waiting to run
Test / pandoc to vimdoc (push) Waiting to run
fix: selenized and solarized extra colors
feat: annotation for config
refactor: search,incsearch,border
2024-08-24 15:27:47 -03:00
.github feat: lazynvim, ci test removed 2024-08-24 08:59:45 -03:00
after/queries fix: jsx tags, methods being italized, incsearch low contrast 2023-10-31 16:04:10 -03:00
colors feat: Solarized theme restructuring 2024-08-23 19:46:38 -03:00
doc chore(doc): auto generate docs 2024-08-24 03:12:10 +00:00
lua fix: selenized and solarized extra colors 2024-08-24 15:27:47 -03:00
plugin feat: Solarized theme restructuring 2024-08-23 19:46:38 -03:00
.gitignore feat: Solarized theme restructuring 2024-08-23 19:46:38 -03:00
.luarc.json feat: Solarized theme restructuring 2024-08-23 19:46:38 -03:00
CHANGELOG.md chore(main): release 3.0.0 2024-05-13 14:21:59 +00:00
CONTRIBUTING.md fix: selenized and solarized extra colors 2024-08-24 15:27:47 -03:00
docker-compose.yml feat: docker-compose 2024-08-03 04:34:46 -03:00
Dockerfile feat: docker-compose 2024-08-03 04:34:46 -03:00
LICENSE Initial commit 2022-04-29 14:08:31 -03:00
README.md Update README.md 2024-03-28 12:20:12 -03:00
stylua.toml feat: solarized-light.yml, contributing.md 2024-08-22 21:39:59 -03:00

solarized-yinyang

Solarized

Neovim LICENSE

Solarized is a sixteen color palette (eight monotones, eight accent colors) designed for use with terminal and gui applications. click here to learn more

solarized

Features

  • Support for Treesitter
  • Support for Semantic highlight
  • Customizability: styles, colors and highlights can all be modified
  • Plugin compatibility
  • Provides users with the option to enable or disable highlight groups
  • Selenized color palette

Requirements

Before using the Solarized Colorscheme, please make sure you have the following requirements installed:

Install from package manager

Download using your preferred package manager.

lazy

  {
    'maxmx03/solarized.nvim',
    lazy = false,
    priority = 1000,
    config = function()
      vim.o.background = 'dark' -- or 'light'

      vim.cmd.colorscheme 'solarized'
    end,
  },

packer

use {
    'maxmx03/solarized.nvim',
    config = function()
      vim.o.background = 'dark' -- or 'light'

      vim.cmd.colorscheme 'solarized'
    end
}

Manual Installation

To manually install Solarized, follow these steps:

  1. Download the stable release of Solarized.
  2. Extract the contents of the release.
  3. Locate the following folders in the extracted files: after, colors, lua, plugin.
  4. Copy these folders to the ~/.config/nvim directory.

Help

Use :h solarized.nvim.txt to get some help

Commands

  • :Solarized colors - Display the Solarized palette in a new buffer
  • :Solarized zen- Removes highlight colors, emphasizing important code segments.

Default Config

vim.o.background = 'dark'

-- default config
require('solarized').setup({
    transparent = false, -- enable transparent background
    palette = 'solarized', -- or selenized
    styles = {
      comments = {},
      functions = {},
      variables = {},
      numbers = {},
      constants = {},
      parameters = {},
      keywords = {},
      types = {},
    },
    enables = {
      bufferline = true,
      cmp = true,
      diagnostic = true,
      dashboard = true,
      editor = true,
      gitsign = true,
      hop = true,
      indentblankline = true,
      lsp = true,
      lspsaga = true,
      navic = true,
      neogit = true,
      neotree = true,
      notify = true,
      noice = true,
      semantic = true,
      syntax = true,
      telescope = true,
      tree = true,
      treesitter = true,
      todo = true,
      whichkey = true,
      mini = true,
    },
    highlights = {},
    colors = {},
    theme = 'default', -- or 'neo'
    autocmd = true,
})

vim.cmd.colorscheme = 'solarized' -- or selenized

Config Themes

Solarized offers two themes: the default Solarized theme and Neo. These themes provide different visual styles to enhance your experience.

require('solarized').setup({
    theme = 'neo' -- or comment to use solarized default theme.
})

Config Styles

The styles config allows you to customize the style of a highlight group.

require('solarized').setup({
    styles = {
      comments = { italic = true, bold = false },
      functions = { italic = true },
      variables = { italic = false },
    }
})

Config Highlights

The highlights config allows you to customize the highlights groups.

example:

require('solarized').setup {
    highlights = function (colors, colorhelper)
        local darken = colorhelper.darken
        local lighten = colorhelper.lighten
        local blend = colorhelper.blend

        return {
            LineNr = { fg = c.base1, bg = c.base02 },
            CursorLineNr = { bg = c.base02 },
            CursorLine = { bg = c.base02 },
            Function = { italic = false },
            Visual = { bg = c.cyan },
        }
    end
}

Config Colors

The colors config allows you to extend or modify the color palette used by solarized.

example:

require('solarized').setup {
    colors = function(colors, colorhelper)
        local darken = colorhelper.darken
        local lighten = colorhelper.lighten
        local blend = colorhelper.blend

        return {
            fg = '#fff', -- output: #ffffff
            bg = darken(colors.base03, 100)
        }
    end,
    highlights = function(colors)
        return {
            Normal = { fg = colors.fg, bg = colors.bg }
        }
    end
}

Config Enables

The enables config allows you to enable or disable solarized support for spefic plugins or neovim's default highlights

example:

require('solarized').setup {
  enables = {
      editor = true,
      syntax = true,

      -- PLUGINS
      bufferline = true,
      cmp = false, -- disabled
      diagnostic = true,
      indentblankline = true,
      lsp = true,
      lspsaga = false, -- disabled
      navic = true,
      semantic = true,
      telescope = true,
      tree = false, -- disabled
      treesitter = true,
    },
    highlights = {
        -- your implementation of nvim-tree
        -- your implementation of cmp
        -- your implementation of lspsaga
    }
}

Config Autocmd

This option enhances highlighting by enabling Solarized's autocmd feature.

Lualine

require('lualine').setup {
  options = {
    theme = 'solarized',
    disabled_filetypes = {
        'NvimTree',
    },
  },
}

Alternatively, to utilize Lualine's Solarized theme:

require('lualine').setup {
    options = {
      theme = require('lualine.themes.solarized')
    }
}

To use the Solarized theme showcased in the screenshot for Lualine click here

Barbecue

require('barbecue').setup {
  theme = 'solarized',
}

Api

You can utilize useful functions to customize your Neovim plugins.

Get Colors

local palette = require('solarized.palette')
local colors = palette.get_colors()

Color utils

local color = require('solarized.utils.colors')

-- Convert a hex color code to RGB
color.hex_to_rgb('#ffffff')

-- Darken a color by a specified percentage
color.darken('#ffffff', 100)

-- Lighten a color by a specified percentage
color.lighten('#000000', 100)

-- Blend two colors with a specified ratio
color.blend('#ffffff', '#000000', 0.15)

How to get color shades

local darken = require('solarized.utils.colors').darken
local colors = require('solarized.palette').get_colors()
for i = 1, 10, 1 do
  local shade = darken(colors.blue, i * 10)

  print(shade)
end

How to get color tints

local lighten = require('solarized.utils.colors').lighten

for i = 1, 10, 1 do
  local tints = lighten(colors.blue, i * 10)

  print(tints)
end

Contributing

Pull requests are welcome and appreciated.

Designed by

Ethan Schoonover

Ethan Schoonover

Credits and Reference 🎉

Raphael