Skip to content

Commit

Permalink
refactor: migrate plugin/*.vim -> plugin/*.lua
Browse files Browse the repository at this point in the history
Using Lua instead provides a few small benefits in this case (bytecode
compilation/caching, `require()` caching, vim command descriptions, LSP,
standard file format, etc.), and it shouldn't cause any issues since we
already don't support vim.
  • Loading branch information
tmillr committed Aug 2, 2024
1 parent b607c2c commit 2936d3b
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 30 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

### Changes

- Moved/migrated `plugin/*.vim` -> `plugin/*.lua`

### Issues Fix

- Made `Color()` constructor idempotent (previously, passing a `Color` inst silently caused a bug)
Expand Down
6 changes: 3 additions & 3 deletions colors/github_dark.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require("github-theme.config").set_theme('github_dark')
require("github-theme").load()
require('github-theme.config').set_theme('github_dark')
require('github-theme').load()

EOF
6 changes: 3 additions & 3 deletions colors/github_dark_colorblind.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require("github-theme.config").set_theme('github_dark_colorblind')
require("github-theme").load()
require('github-theme.config').set_theme('github_dark_colorblind')
require('github-theme').load()

EOF
6 changes: 3 additions & 3 deletions colors/github_dark_default.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require("github-theme.config").set_theme('github_dark_default')
require("github-theme").load()
require('github-theme.config').set_theme('github_dark_default')
require('github-theme').load()

EOF
2 changes: 1 addition & 1 deletion colors/github_dark_dimmed.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require('github-theme.config').set_theme('github_dark_dimmed')
require('github-theme').load()
Expand Down
2 changes: 1 addition & 1 deletion colors/github_dark_high_contrast.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require('github-theme.config').set_theme('github_dark_high_contrast')
require('github-theme').load()
Expand Down
2 changes: 1 addition & 1 deletion colors/github_dark_tritanopia.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require('github-theme.config').set_theme('github_dark_tritanopia')
require('github-theme').load()
Expand Down
6 changes: 3 additions & 3 deletions colors/github_light.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require("github-theme.config").set_theme('github_light')
require("github-theme").load()
require('github-theme.config').set_theme('github_light')
require('github-theme').load()

EOF
6 changes: 3 additions & 3 deletions colors/github_light_colorblind.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require("github-theme.config").set_theme('github_light_colorblind')
require("github-theme").load()
require('github-theme.config').set_theme('github_light_colorblind')
require('github-theme').load()

EOF
6 changes: 3 additions & 3 deletions colors/github_light_default.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require("github-theme.config").set_theme('github_light_default')
require("github-theme").load()
require('github-theme.config').set_theme('github_light_default')
require('github-theme').load()

EOF
2 changes: 1 addition & 1 deletion colors/github_light_high_contrast.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require('github-theme.config').set_theme('github_light_high_contrast')
require('github-theme').load()
Expand Down
2 changes: 1 addition & 1 deletion colors/github_light_tritanopia.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lua << EOF

if vim.g.github_theme_debug then
require("github-theme.util.reload")()
require('github-theme.util.reload')()
end
require('github-theme.config').set_theme('github_light_tritanopia')
require('github-theme').load()
Expand Down
9 changes: 9 additions & 0 deletions plugin/github_theme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local api = vim.api

api.nvim_create_user_command('GithubThemeCompile', function(_info)
require('github-theme').compile(true)
end, { desc = 'Forcefully recompile settings and persist to fs', force = true })

api.nvim_create_user_command('GithubThemeInteractive', function(_info)
require('github-theme.interactive').attach()
end, { desc = 'Reload on buffer save', force = true })
7 changes: 0 additions & 7 deletions plugin/github_theme.vim

This file was deleted.

0 comments on commit 2936d3b

Please sign in to comment.