Skip to content

Commit 88d4373

Browse files
committed
Deprecated: Configuration using vim.g.github_* removed.
This commit includes the removal of all supportive modules from the Vim configuration that were using `vim.g.github_*`. Please migrate to the `setup` Lua function. Updated documentation can be found in the README. Additionally, a new library called `deprecation` has been added for writing deprecation warning messages. For further information about the deprecated modules and their replacements, please refer to the `:h github-theme.deprecated` documentation.
1 parent b888267 commit 88d4373

File tree

11 files changed

+193
-187
lines changed

11 files changed

+193
-187
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
### What's New?
11+
12+
- Added a Deprecation library to print Deprecation Messages.
13+
14+
### Changes
15+
16+
- The `config.default` module has been changed to a variable and moved inside the `config` module.
17+
18+
### Deprecation
19+
20+
- The `config.vim_config` and `config.default` modules are now deprecated.
21+
- The `config.apply_configuration()` function is also deprecated.
22+
1023
## [v0.0.7] - 16 January 2023
1124

1225
### Changes

README.md

-92
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,7 @@ use({
7878

7979
Enable the colorscheme:
8080

81-
```vim
82-
" Vim Script
83-
colorscheme github_*
84-
```
85-
8681
```lua
87-
-- Lua
8882
require('github-theme').setup()
8983
```
9084

@@ -108,26 +102,6 @@ require('github-theme').setup()
108102
| transparent | `false` | Enable this to disable setting the background color |
109103
| variable_style | `NONE` | Highlight style for variables and identifiers (check `:help highlight-args` for options) |
110104

111-
### Using `vim`
112-
113-
```vim
114-
" Example config in VimScript
115-
" NOTE: Configuration needs to be set BEFORE loading the color scheme with `colorscheme` command
116-
let g:github_function_style = "italic"
117-
let g:github_sidebars = ["qf", "vista_kind", "terminal", "packer"]
118-
119-
" Change the "hint" color to the "orange" color, and make the "error" color bright red
120-
let g:github_colors = {
121-
\ 'hint': 'orange',
122-
\ 'error': '#ff0000'
123-
\ }
124-
125-
" Load the colorscheme
126-
colorscheme github_dark
127-
```
128-
129-
### Using `lua`
130-
131105
```lua
132106
-- Example config in Lua
133107
require("github-theme").setup({
@@ -220,13 +194,7 @@ set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{25
220194

221195
#### Dark
222196

223-
```vim
224-
" VimScript
225-
colorscheme github_dark
226-
```
227-
228197
```lua
229-
-- Lua
230198
require("github-theme").setup({
231199
theme_style = "dark",
232200
-- other config
@@ -237,13 +205,7 @@ require("github-theme").setup({
237205

238206
#### Dimmed
239207

240-
```vim
241-
" VimScript
242-
colorscheme github_dimmed
243-
```
244-
245208
```lua
246-
-- Lua
247209
require("github-theme").setup({
248210
theme_style = "dimmed",
249211
-- other config
@@ -254,13 +216,7 @@ require("github-theme").setup({
254216

255217
#### Dark Default
256218

257-
```vim
258-
" VimScript
259-
colorscheme github_dark_default
260-
```
261-
262219
```lua
263-
-- Lua
264220
require("github-theme").setup({
265221
theme_style = "dark_default",
266222
-- other config
@@ -271,13 +227,7 @@ require("github-theme").setup({
271227

272228
#### Dark Colorblind (Beta)
273229

274-
```vim
275-
" VimScript
276-
colorscheme github_dark_colorblind
277-
```
278-
279230
```lua
280-
-- Lua
281231
require("github-theme").setup({
282232
theme_style = "dark_colorblind",
283233
-- other config
@@ -288,13 +238,7 @@ require("github-theme").setup({
288238

289239
#### Light
290240

291-
```vim
292-
" VimScript
293-
colorscheme github_light
294-
```
295-
296241
```lua
297-
-- Lua
298242
require("github-theme").setup({
299243
theme_style = "light",
300244
-- other config
@@ -305,13 +249,7 @@ require("github-theme").setup({
305249

306250
#### Light Default
307251

308-
```vim
309-
" VimScript
310-
colorscheme github_light_default
311-
```
312-
313252
```lua
314-
-- Lua
315253
require("github-theme").setup({
316254
theme_style = "light_default",
317255
-- other config
@@ -322,13 +260,7 @@ require("github-theme").setup({
322260

323261
#### Light Colorblind (Beta)
324262

325-
```vim
326-
" VimScript
327-
colorscheme github_light_colorblind
328-
```
329-
330263
```lua
331-
-- Lua
332264
require("github-theme").setup({
333265
theme_style = "light_colorblind",
334266
-- other config
@@ -345,16 +277,7 @@ require("github-theme").setup({
345277

346278
#### Normal
347279

348-
```vim
349-
" VimScript
350-
let g:github_comment_style = "NONE"
351-
let g:github_keyword_style = "NONE"
352-
let g:github_function_style = "NONE"
353-
let g:github_variable_style = "NONE"
354-
```
355-
356280
```lua
357-
-- Lua
358281
require("github-theme").setup({
359282
comment_style = "NONE",
360283
keyword_style = "NONE",
@@ -368,16 +291,7 @@ require("github-theme").setup({
368291

369292
#### Italic
370293

371-
```vim
372-
" VimScript
373-
let g:github_comment_style = "italic"
374-
let g:github_keyword_style = "italic"
375-
let g:github_function_style = "italic"
376-
let g:github_variable_style = "italic"
377-
```
378-
379294
```lua
380-
-- Lua
381295
require("github-theme").setup({
382296
comment_style = "italic",
383297
keyword_style = "italic",
@@ -391,13 +305,7 @@ require("github-theme").setup({
391305

392306
### Minimal config
393307

394-
```vim
395-
" VimScript
396-
let g:github_dark_sidebar = 0
397-
```
398-
399308
```lua
400-
-- Lua
401309
require("github-theme").setup({
402310
dark_sidebar = false,
403311
-- other config

doc/gt_changelog.txt

+16
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33

44
# Changelog
55

6+
*github-theme.changelog-06042023*
7+
8+
Date: April 06, 2023
9+
10+
The secondary method of assigning configuration variables using
11+
|'vim.g.github_*'| is now considered deprecated. Instead, it is recommended to
12+
use the |'require("github-theme").setup({...})'| function to assign
13+
configurations.
14+
15+
Any references to the deprecated modules and options can be found in the
16+
documentation located at `:h gt_deprecated.txt`.
17+
18+
19+
620
*github-theme.changelog-03012023*
721

822
Date: January 03, 2023
@@ -22,6 +36,8 @@ To ensure that the community is aware of any major changes before they are
2236
implemented, I will provide advance warning before any potentially breaking
2337
changes are pushed to upstream.
2438

39+
40+
2541
*github-theme.changelog-03082022*
2642

2743
Date: August 03, 2022

doc/gt_deprecated.txt

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
*gt_deprecated.txt* github-nvim-theme
2+
3+
GITHUB NVIM THEME DEPRECATION REFRENCE
4+
5+
github-nvim-theme *github-theme.deprecated*
6+
7+
The items listed below are deprecated: they will be removed in the future.
8+
They should not be used in new scripts, and old scripts should be updated.
9+
10+
==============================================================================
11+
Deprecated features
12+
13+
14+
MODULES
15+
- *'config.vim_config'* Deprecated.
16+
- *'config.default'* Moved to |'github-theme.config'|
17+
module and accessed with |'default'| variable.
18+
19+
GLOBAL OPTIONS
20+
- *'vim.g.github_theme_style'* Use |setup| Lua function instead.
21+
- *'vim.g.github_colors'* Use |setup| Lua function instead.
22+
- *'vim.g.github_overrides'* Use |setup| Lua function instead.
23+
- *'vim.g.github_dark_float'* Use |setup| Lua function instead.
24+
- *'vim.g.github_dark_sidebar'* Use |setup| Lua function instead.
25+
- *'vim.g.github_sidebars'* Use |setup| Lua function instead.
26+
- *'vim.g.github_transparent'* Use |setup| Lua function instead.
27+
- *'vim.g.github_hide_end_of_buffer'* Use |setup| Lua function instead.
28+
- *'vim.g.github_hide_inactive_statusline'* Use |setup| Lua function instead.
29+
- *'vim.g.github_msg_area_style'* Use |setup| Lua function instead.
30+
- *'vim.g.github_comment_style'* Use |setup| Lua function instead.
31+
- *'vim.g.github_function_style'* Use |setup| Lua function instead.
32+
- *'vim.g.github_keyword_style'* Use |setup| Lua function instead.
33+
- *'vim.g.github_variable_style'* Use |setup| Lua function instead.
34+
- *'vim.g.github_dev'* Use |setup| Lua function instead.
35+
36+
FUNCTIONS
37+
- *'config.apply_configuration()'* Deprecated.
38+
39+
40+
vim:noet:tw=78:ts=8:ft=help:norl:

lua/github-theme/config.lua

+21-41
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
1-
local vim_config = require('github-theme.config.vim_config')
2-
local default_config = require('github-theme.config.default')
1+
local M = {}
2+
local types = require('github-theme.types')
33

4-
---@class gt.Config
5-
---@field schema gt.ConfigSchema
6-
local config = {}
7-
8-
---Accessing global config using vim.g.github_* will help in autocompletion.
9-
10-
config.schema = {
11-
colors = vim_config.get(vim.g.github_colors, default_config.colors),
12-
comment_style = vim_config.get(vim.g.github_comment_style, default_config.comment_style),
13-
dark_float = vim_config.get(vim.g.github_dark_float, default_config.dark_float),
14-
dark_sidebar = vim_config.get(vim.g.github_dark_sidebar, default_config.dark_sidebar),
15-
dev = vim_config.get(vim.g.github_dev, default_config.dev),
16-
function_style = vim_config.get(vim.g.github_function_style, default_config.function_style),
17-
hide_end_of_buffer = vim_config.get(vim.g.github_hide_end_of_buffer, default_config.hide_end_of_buffer),
18-
hide_inactive_statusline = vim_config.get(vim.g.github_hide_inactive_statusline, default_config.hide_inactive_statusline),
19-
keyword_style = vim_config.get(vim.g.github_keyword_style, default_config.keyword_style),
20-
msg_area_style = vim_config.get(vim.g.github_msg_area_style, default_config.msg_area_style),
21-
overrides = vim_config.get(vim.g.github_overrides, default_config.overrides),
22-
sidebars = vim_config.get(vim.g.github_sidebars, default_config.sidebars),
23-
theme_style = vim_config.get(vim.g.github_theme_style, default_config.theme_style),
24-
transparent = vim_config.get(vim.g.github_transparent, default_config.transparent),
25-
variable_style = vim_config.get(vim.g.github_variable_style, default_config.variable_style),
4+
M.default = {
5+
colors = {},
6+
comment_style = types.gt.HighlightStyle.Italic,
7+
dark_float = false,
8+
dark_sidebar = true,
9+
dev = false,
10+
function_style = types.gt.HighlightStyle.None,
11+
hide_end_of_buffer = true,
12+
hide_inactive_statusline = true,
13+
keyword_style = types.gt.HighlightStyle.Italic,
14+
msg_area_style = types.gt.HighlightStyle.None,
15+
overrides = function()
16+
return {}
17+
end,
18+
sidebars = {},
19+
theme_style = types.gt.ThemeStyle.Dark,
20+
transparent = false,
21+
variable_style = types.gt.HighlightStyle.None,
2622
}
2723

28-
---Override user's configuration
29-
---@param user_config gt.ConfigSchema
30-
config.apply_configuration = function(user_config)
31-
for key, value in pairs(user_config) do
32-
if value ~= nil then
33-
if config.schema[key] ~= nil then
34-
-- override value
35-
config.schema[key] = value
36-
vim_config.set(key, value)
37-
else
38-
error('config ' .. key .. ' does not exist') -- luacheck: ignore
39-
end
40-
end
41-
end
42-
end
43-
44-
return config
24+
return M

lua/github-theme/config/default.lua

-22
This file was deleted.

lua/github-theme/config/vim_config.lua

-23
This file was deleted.

0 commit comments

Comments
 (0)