Code Monkey home page Code Monkey logo

solarized.nvim's Introduction

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

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.

Get some help

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

Commands

:SolarizedColors - Display the Solarized palette in a new buffer

Default Config

vim.o.background = 'dark'

-- default config
require('solarized').setup({
    transparent = false, -- enable transparent background
    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,
      neotree = true,
      notify = true,
      semantic = true,
      syntax = true,
      telescope = true,
      tree = true,
      treesitter = true,
      whichkey = true,
      mini = true,
    },
    highlights = {},
    colors = {},
    theme = 'default', -- or 'neosolarized' or 'neo' for short
})

vim.cmd.colorscheme = 'solarized'

Config Themes

Solarized offers two themes: the default Solarized theme and Neosolarized. 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 },
            CmpKindBorder = { fg = c.base01, bg = c.base04 }
        }
    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, 10)
        }
    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
    }
}

Lualine

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

Api

You can utilize useful functions to customize your Neovim plugins.

Get Colors

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

Colorhelper

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

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

-- Convert RGB values to HSL
colorhelper.rgb_to_hsl(255, 255, 255)

-- Convert HSL values to RGB
colorhelper.hsl_to_rgb(0, 0, 100)

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

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

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

Contributing

Thank you for your interest in contributing to this project! To ensure a smooth collaboration, please follow the guidelines below:

  1. Open a discussion to propose and discuss the changes you intend to make. This step allows for valuable input and feedback from the project maintainers and the community.
  2. Ensure you have the latest changes from the dev branch by pulling the latest updates.
  3. Make your changes on the dev branch. Avoid making direct changes to the main branch.
  4. Before submitting a pull request, run the ./test.py script to ensure that your changes pass all the necessary tests. This step helps maintain the quality and stability of the project.
  5. When submitting a pull request, make sure to select the dev branch as the target branch. This ensures that your changes will be merged into the dev branch for further review and integration.
  6. Provide a clear and descriptive title and description for your pull request, explaining the purpose and scope of your changes.
  7. Wait for the maintainer to review your pull request.
  8. Once your changes have been reviewed and approved, the project maintainer will handle merging your changes into the main branch.

Designed by

Ethan Schoonover

Ethan Schoonover

Credits and Reference ๐ŸŽ‰

Raphael

Raphael

solarized.nvim's People

Contributors

github-actions[bot] avatar maxmx03 avatar redstreet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.