Giter Site home page Giter Site logo

bamboo.nvim's Introduction

bamboo.nvim

Dark green theme for Neovim $\ge$ 0.5 forked from OneDark.nvim. Theme written in Lua with Tree-sitter syntax highlighting and LSP semantic highlighting.

For latest Tree-sitter syntax highlighting, upgrade to Neovim 0.8.0 or later, built with Tree-sitter 0.20.3+.

Features

  • Blue and purple are used sparingly to help reduce eye strain
  • Red, yellow, and green are prioritized more for the same reason
  • Comments are colored specifically to be readable and have good contrast with other text and background
  • Many semantic highlighting tokens are handled and colored nicely
  • Light and dark variants
    • Light mode only applies when vim.o.background = 'light' (can also use set background=light)
  • Multiple plugins are supported with hand-picked, proper colors
  • Colors, highlights, and code style of the theme can be customized as you like (refer to Customization)
  • Integration with other applications (see the extras directory)

Regular (vulgaris)

Click to toggle previews

bamboomdshowcase bamboocodeshowcase

Greener (multiplex)

Click to toggle previews

bamboomultiplexshowcase bamboomultiplexshowcasecode

Light Mode (light)

Click to toggle previews

bamboolightshowcasemd bamboolightshowcasecode


Note

The above screenshots utilize Tree-sitter parsers for lua, markdown, markdown_inline, mermaid, and latex.

The lua file screenshot also uses a custom query to highlight the vim global as a builtin variable rather than a constant, changing it from pink to red. If you want this behavior, add the following to a queries/lua/highlights.scm file in your config directory (the extends comment is necessary):

;; extends
(
 (identifier) @variable.builtin
 (#any-of? @variable.builtin "vim")
 (#set! "priority" 128)
)

Installation

Install via your favorite package manager:

-- Using lazy.nvim
{
  'ribru17/bamboo.nvim',
  lazy = false,
  priority = 1000,
  config = function()
    require('bamboo').setup {
      -- optional configuration here
    }
    require('bamboo').load()
  end,
},

Tip

For best results, use (rounded) borders for float windows (or change their background to a slightly different color than the main editor background).

Configuration

Enable theme

-- Lua
require('bamboo').load()
" Vim
colorscheme bamboo

Default Configuration

-- Lua
require('bamboo').setup {
  -- Main options --
  -- NOTE: to use the light theme, set `vim.o.background = 'light'`
  style = 'vulgaris', -- Choose between 'vulgaris' (regular), 'multiplex' (greener), and 'light'
  toggle_style_key = nil, -- Keybind to toggle theme style. Leave it nil to disable it, or set it to a string, e.g. "<leader>ts"
  toggle_style_list = { 'vulgaris', 'multiplex', 'light' }, -- List of styles to toggle between
  transparent = false, -- Show/hide background
  dim_inactive = false, -- Dim inactive windows/buffers
  term_colors = true, -- Change terminal color as per the selected theme style
  ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden
  cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu

  -- Change code style ---
  -- Options are italic, bold, underline, none
  -- You can configure multiple style with comma separated, For e.g., keywords = 'italic,bold'
  code_style = {
    comments = 'italic',
    conditionals = 'italic',
    keywords = 'none',
    functions = 'none',
    namespaces = 'italic',
    parameters = 'italic',
    strings = 'none',
    variables = 'none',
  },

  -- Lualine options --
  lualine = {
    transparent = false, -- lualine center bar transparency
  },

  -- Custom Highlights --
  colors = {}, -- Override default colors
  highlights = {}, -- Override highlight groups

  -- Plugins Config --
  diagnostics = {
    darker = false, -- darker colors for diagnostic
    undercurl = true, -- use undercurl instead of underline for diagnostics
    background = true, -- use background color for virtual text
  },
}

Vimscript Configuration

Bamboo can be configured also with Vimscript, using the global dictionary g:bamboo_config. NOTE: when setting boolean values use v:true and v:false instead of 0 and 1.

Example:

let g:bamboo_config = {
  \ 'ending_tildes': v:true,
  \ 'diagnostics': {
    \ 'darker': v:true,
    \ 'background': v:false,
  \ },
\ }
colorscheme bamboo

Customization

Example using custom colors and highlights:

require('bamboo').setup {
  colors = {
    bright_orange = '#ff8800', -- define a new color
    green = '#00ffaa', -- redefine an existing color
  },
  highlights = {
    -- make comments blend nicely with background, similar to other color schemes
    ['@comment'] = { fg = '$grey' },

    ['@keyword'] = { fg = '$green' },
    ['@string'] = { fg = '$bright_orange', bg = '#00ff00', fmt = 'bold' },
    ['@function'] = { fg = '#0000ff', sp = '$cyan', fmt = 'underline,italic' },
    ['@function.builtin'] = { fg = '#0059ff' },
  },
}

Note that Tree-sitter keywords have been changed after Neovim version 0.8 and onwards. TS prefix is trimmed and lowercase words are separated with ..

The old way before neovim 0.8 looks like this. All highlights used in this colorscheme can be found in this file.

require('bamboo').setup {
  colors = {
    bright_orange = '#ff8800', -- define a new color
    green = '#00ffaa', -- redefine an existing color
  },
  highlights = {
    TSKeyword = { fg = '$green' },
    TSString = { fg = '$bright_orange', bg = '#00ff00', fmt = 'bold' },
    TSFunction = { fg = '#0000ff', sp = '$cyan', fmt = 'underline,italic' },
    TSFuncBuiltin = { fg = '#0059ff' },
  },
}

Plugins Supported

Reference

License

MIT

bamboo.nvim's People

Contributors

aikow avatar kevhlee avatar lkhphuc avatar nadir-yttrium avatar ribru17 avatar vihu 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.