Giter VIP home page Giter VIP logo

neovim-ayu's Introduction

Neovim Ayu

A colorscheme for Neovim 0.8+ reimplemented in lua from ayu-vim.

Screenshots

dark

mirage

light

Commands

To apply the colorscheme, you can call require('ayu').colorscheme() from lua or use :colorscheme ayu command. By default it respects your 'background' (see :h background) setting to choose between dark and light variants. But you can use the :colorscheme ayu-dark, :colorscheme ayu-light, or :colorscheme ayu-mirage commands to apply a variant directly.

Configuration

To configure the plugin, you can call require('ayu').setup(values), where values is a dictionary with the parameters you want to override. Here are the defaults:

require('ayu').setup({
    mirage = false, -- Set to `true` to use `mirage` variant instead of `dark` for dark background.
    overrides = {}, -- A dictionary of group names, each associated with a dictionary of parameters (`bg`, `fg`, `sp` and `style`) and colors in hex.
})

Alternatively, overrides can be a function that returns a dictionary of the same format. You can use the function to override based on a dynamic condition, such as the value of 'background'.

Colorscheme also provides a theme for lualine.nvim. You can set in setup lualine:

require('lualine').setup({
  options = {
    theme = 'ayu',
  },
})

Overrides examples

Transparency

require('ayu').setup({
    overrides = {
        Normal = { bg = "None" },
        ColorColumn = { bg = "None" },
        SignColumn = { bg = "None" },
        Folded = { bg = "None" },
        FoldColumn = { bg = "None" },
        CursorLine = { bg = "None" },
        CursorColumn = { bg = "None" },
        WhichKeyFloat = { bg = "None" },
        VertSplit = { bg = "None" },
    },
})

Tip: You can use :source $VIMRUNTIME/syntax/hitest.vim to see all highlighting groups.

Re-use colors from the colorscheme

local colors = require('ayu.colors')
colors.generate() -- Pass `true` to enable mirage

require('ayu').setup({
  overrides = {
    IncSearch = { fg = colors.fg }
  }
})

Tip: You can use :lua print(vim.inspect(require('ayu.colors'))) command to check all available colors.

Set background color of non-active windows for both light and dark backgrounds

In this case you need to use a function to dynamically generate colors:

require('ayu').setup({
  overrides = function()
    if vim.o.background == 'dark' then
      return { NormalNC = {bg = '#0f151e', fg = '#808080'} }
    else
      return { NormalNC = {bg = '#f0f0f0', fg = '#808080'} }
    end
  end
})

Tip: If you use ayu.colors as in the example above, you don't need to check for vim.o.background, but you still need to use a function.

Disable italic for comments

local colors = require('ayu.colors')
colors.generate() -- Pass `true` to enable mirage

require('ayu').setup({
  overrides = function()
    return { Comment = { fg = colors.comment } }
  end
})

neovim-ayu's People

Contributors

bmulholland avatar cantoromc avatar fedex159 avatar jemag avatar killwing avatar metalelf0 avatar philrunninger avatar rami3l avatar rohit-kumar-j avatar shatur avatar windwp 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.