Skip to content

Commit

Permalink
New configuration system and more (Ref #96) (#122)
Browse files Browse the repository at this point in the history
* initial work

* adding more tests

* updates

* fixing overrides in groups with links

* fix bg switch and some hl groups

* adding languages hl groups

* adding plugins highlights

* stylua

* removing base module and fixing lightline

* adding terminal_color_* vars

* adding new screenshot
  • Loading branch information
ellisonleao authored Jun 28, 2022
1 parent 3352c12 commit 7a5c7ac
Show file tree
Hide file tree
Showing 14 changed files with 908 additions and 831 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
on: [push, pull_request]
name: default

jobs:
stylua:
name: stylua
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: JohnnyMorganz/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --color always --check lua

test:
runs-on: ubuntu-latest
strategy:
matrix:
nvim-versions: ['stable', 'nightly']
name: test
steps:
- name: checkout
uses: actions/checkout@v2

- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.nvim-versions }}

- name: run tests
run: make test
env:
PLENARY_DIR: vendor/plenary.nvim
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TESTS_INIT=tests/minimal_init.lua
TESTS_DIR=tests/

.PHONY: test

test:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "PlenaryBustedDirectory ${TESTS_DIR} { minimal_init = '${TESTS_INIT}' }"
61 changes: 48 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

A port of [gruvbox community](https://github.com/gruvbox-community/gruvbox) theme to lua with [treesitter](https://github.com/nvim-treesitter/nvim-treesitter) support!

<p align="center">
<img src="https://i.postimg.cc/fy3tnGFt/gruvbox-themes.png" />
</p>

# Prerequisites

Neovim 0.7.0+
Expand All @@ -26,7 +30,7 @@ Using `packer`
use { "ellisonleao/gruvbox.nvim" }
```

# Usage
# Basic Usage

Inside `init.vim`

Expand All @@ -38,13 +42,54 @@ colorscheme gruvbox
Inside `init.lua`

```lua
vim.opt.background = "dark" -- or "light" for light mode
vim.o.background = "dark" -- or "light" for light mode
vim.cmd([[colorscheme gruvbox]])
```

# Configuration

all `g:gruvbox_` configs are the same [as the original one](https://github.com/morhetz/gruvbox/wiki/Configuration) except for `g:gruvbox_guisp_fallback`
Additional settings for gruvbox are:

```lua
-- setup must be called before loading the colorscheme
-- Default options:
require("gruvbox").setup({
undercurl = true,
underline = true,
bold = true,
italic = true, -- will make italic comments and special strings
invert_selection = false,
invert_signs = false,
invert_tabline = false,
invert_intend_guides = false,
contrast = "hard", -- can be "hard" or "light"
overrides = {},
})
vim.cmd("colorscheme gruvbox")
```

## Overriding Highlight groups

If you don't enjoy the current color for a specific highlight group, now you can just override it in the setup. For
example:

```lua
require("gruvbox").setup({
overrides = {
SignColumn = {bg = "#ff9900"}
}
})
vim.cmd("colorscheme gruvbox")
```

Please note that the override values must follow the attributes from the highlight group map, such as:

- **fg** - foreground color
- **bg** - background color
- **bold** - true or false for bold font
- **italic** - true or false for italic font

Other values can be seen in `:h synIDattr`

# Additional supported plugins

Expand All @@ -54,13 +99,3 @@ all `g:gruvbox_` configs are the same [as the original one](https://github.com/m
- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)

And more..

# Screenshots

## dark mode

![Screenshot-from-2021-02-25-11-41-18.png](https://i.postimg.cc/66fSHrV8/Screenshot-from-2021-02-25-11-41-18.png)

## light mode

![Screenshot-from-2021-02-25-11-41-33.png](https://i.postimg.cc/pXVS3mkq/Screenshot-from-2021-02-25-11-41-33.png)
5 changes: 0 additions & 5 deletions colors/gruvbox.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
package.loaded["gruvbox"] = nil
package.loaded["gruvbox.base"] = nil
package.loaded["gruvbox.plugins"] = nil
package.loaded["gruvbox.lightline"] = nil
package.loaded["gruvbox.languages"] = nil
require("gruvbox").load()
Loading

0 comments on commit 7a5c7ac

Please sign in to comment.