tmillr / github-nvim-theme

Github's Neovim themes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

github-nvim-theme

Notices

shoutout-sponsors

Note All features and bug fixes are on hold while we focus on a refactor of the theme. If you would like to be involved in the discussion or have input to share, please join us as soon as possible. Thank you for your understanding.

Subscribe to this discussion or :h github-theme-changelog to receive updates on breaking changes and deprecations.

  • 2022-08-03: Terminal and other themes have been moved to github-theme-contrib git repository and related code have been removed from this repository.

Requirements

  • Neovim >= 0.5.0

Installation

Warning Use the latest release tag or 0.0.x branch for updates, not the main branch.

Install the theme with your preferred package manager:

Install with vim-plug:

Plug 'projekt0n/github-nvim-theme', { 'tag': 'v0.0.7' }
" or                                { 'branch': '0.0.x' }

Or with dein:

call dein#add('projekt0n/github-nvim-theme', { 'rev': 'v0.0.7' })
" or                                         { 'rev': '0.0.x' }

Or with minpac:

call minpac#add('projekt0n/github-nvim-theme', { 'rev': 'v0.0.7' })
" or                                           { 'rev': '0.0.x' }

Or with Packer.nvim:

Add this in your init.lua or plugins.lua

-- Install without configuration
use ({ 'projekt0n/github-nvim-theme', tag = 'v0.0.7' })
-- or                                 branch = '0.0.x'

-- Or with configuration
use({
  'projekt0n/github-nvim-theme', tag = 'v0.0.7',
-- or                            branch = '0.0.x'
  config = function()
    require('github-theme').setup({
      -- ...
    })

    vim.cmd('colorscheme github_dark')
  end
})

Or with lazy.nvim:

Add this in your init.lua or plugins.lua

-- Install without configuration
{ 'projekt0n/github-nvim-theme', version = 'v0.0.7' }
-- or                                 branch = '0.0.x'

-- Or with configuration
{
  'projekt0n/github-nvim-theme', version = 'v0.0.7',
-- or                            branch = '0.0.x'
  config = function()
    require('github-theme').setup({
      -- ...
    })

    vim.cmd('colorscheme github_dark')
  end
}

Usage

Setting the colorscheme:

require('github-theme').setup()

Enable the colorscheme:

vim.cmd('colorscheme github_dark')

Configuration

-- Default config
require('github-theme').setup({
  options = {
    compile_file_suffix = '_compiled',
    compile_path = '<neovim-cache-dir>/github-theme',
    hide_end_of_buffer = true,
    hide_nc_statusline = true,
    terminal_colors = true,
    transparent = false,
    module_default = true,
    styles = {
      comments = 'italic',
      functions = 'NONE',
      keywords = 'italic',
      variables = 'NONE',
      conditionals = 'NONE',
      constants = 'NONE',
      numbers = 'NONE',
      operators = 'NONE',
      strings = 'NONE',
      types = 'NONE',
    },
    darken = {
      floats = false,
      sidebars = {
        enable = true,
        list = {},
      },
    },
    modules = {
      coc = {
        background = true,
      },
      diagnostic = {
        -- This is linked to so much that is needs to be enabled. This is here primarily
        -- for the extra options that can be added with modules
        enable = true,
        background = false,
      },
      native_lsp = {
        enable = true,
        background = true,
      },
      treesitter = true,
      lsp_semantic_tokens = true,
    },
  },
  palettes = {},
  specs = {},
  groups = {},
})

Overriding specs and groups Example:

require('github-theme').setup({
  specs = {
    -- Change the color of only the 'github_dark' theme's 'hint' color to magenta and make the 'error' color a dim red.
    github_dark = {
      diag = {
        error = '#660000',
        hint = 'magenta.base',
      },
    },
    -- Change the "hint" color to the "orange" color, and make the "error" color bright red.
    all = {
      diag = {
        error = '#ff0000',
        hint = 'orange',
      },
    },
  },

  -- Overwrite the highlight groups for all colorschemes
  groups = {
    all = {
      htmlTag = { fg = 'palette.red', bg = '#282c34', sp = 'diag.hint', style = 'underline,bold' },
      DiagnosticHint = { link = 'LspDiagnosticsDefaultHint' },
      -- this will remove the highlight groups
      TSField = {},
    },
  },
})

Features

Lualine Support

Installation docs and screenshots at LUALINE.md.

Terminal Themes

Moved to projekt0n/github-theme-contrib git repository

Making undercurls work properly in Tmux

To have undercurls show up and in color, add the following to your Tmux config file:

# Undercurl
set -g default-terminal "${TERM}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'  # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'  # underscore colours - needs tmux-3.0

Screenshots

Theme Styles

Dark

require("github-theme").setup({
  -- ...
})

vim.cmd('colorscheme github_dark')

github_dark

Dimmed

require("github-theme").setup({
  -- ...
})

vim.cmd('colorscheme github_dimmed')

github_dimmed

Dark Default

require("github-theme").setup({
  -- ...
})

vim.cmd('colorscheme github_dark_default')

github_dark_default

Dark Colorblind (Beta)

require("github-theme").setup({
  -- ...
})

vim.cmd('colorscheme github_dark_colorblind')

github_dark_colorblind

Light

require("github-theme").setup({
  -- ...
})

vim.cmd('colorscheme github_light')

github_light

Light Default

require("github-theme").setup({
  -- ...
})

vim.cmd('colorscheme github_light_default')

github_light_default

Light Colorblind (Beta)

require("github-theme").setup({
  -- ...
})

vim.cmd('colorscheme github_light_colorblind')

github_light_colorblind

Syntax Styles

Default

github_default_syntax

Normal

require("github-theme").setup({
  options = {
    styles = {
      comments = "NONE",
      functions = "NONE",
      keywords = "NONE",
      variables = "NONE"
    }
  },
  -- ...
})

github_normal_syntax

Italic

require("github-theme").setup({
  options = {
    styles = {
      comments = "italic",
      functions = "italic",
      keywords = "italic",
      variables = "italic"
    }
  },
  -- ...
})

github_italic_syntax

Minimal config

require('github-theme').setup({
  options = {
    darken = {
      sidebars = {
        enable = true,
      },
      -- ...
    },
    -- ...
  },
  -- ...
})

vim.cmd('colorscheme github_dark')

github_minimal

Telescope

github_telescope

Contributing

See CONTRIBUTING.md

Copying

This project is released under the terms of the MIT license. See LICENCE for more information or see opensource.org

About

Github's Neovim themes

License:MIT License


Languages

Language:Lua 95.4%Language:Scheme 2.7%Language:Vim Script 1.9%Language:Makefile 0.1%