-
Notifications
You must be signed in to change notification settings - Fork 0
feat: make mode colors user-configurable via g:tabs_vim_colors #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # 002. Themes | ||
|
|
||
| **SPEC:** tabs.vim | ||
| **Status:** Accepted | ||
| **Last Updated:** 2026-04-04 | ||
|
|
||
| --- | ||
|
|
||
| ## Decision | ||
|
|
||
| Expose mode colors via a single `g:tabs_vim_colors` dict. Each key is a lowercase mode name (`normal`, `insert`, `visual`, `replace`, `command`, `terminal`); each value is a four-element list `[guifg, guibg, ctermfg, ctermbg]`. Users may override any subset; omitted modes fall back to the built-in Dracula defaults. The dict is read once at plugin load after `colorscheme` is applied. | ||
|
|
||
| ## Context | ||
|
|
||
| The plugin hard-codes a Dracula palette directly in `hi` statements. Users with different colorschemes (gruvbox, tokyonight, catppuccin, etc.) have no way to adapt the tab bar without patching the plugin source. This blocks adoption for anyone not on Dracula. | ||
|
|
||
| The solution must be: | ||
| - **Simple to configure** — one variable, no theme files, no function calls | ||
| - **Partial** — users shouldn't have to restate all six modes to change one | ||
| - **Familiar** — borrow a convention from the Vim plugin ecosystem | ||
|
|
||
| ## Considered Options | ||
|
|
||
| | Option | Pros | Cons | | ||
| |--------|------|------| | ||
| | **`g:tabs_vim_colors` dict with `[fg, bg, ctermfg, ctermbg]` arrays** *(chosen)* | Compact; partial overrides; same format as lightline.vim palettes | Positional array is less self-documenting than named keys | | ||
| | Named-key dicts per mode (`{'fg': ..., 'bg': ...}`) | More readable | ~3× more verbose for a full override; no established Vim convention | | ||
| | Theme names (`g:tabs_vim_theme = 'gruvbox'`) | One-line for known themes | Requires bundling per-theme files; doesn't cover custom palettes | | ||
| | Let users define `TabsVim_*` highlight groups directly | Maximum control | No discovery; plugin must not clobber user hi definitions set before load | | ||
|
|
||
| The positional array format is the de facto standard in the Vim statusline plugin ecosystem (lightline.vim uses the identical `[fg, bg, ctermfg, ctermbg]` layout for its palette dicts). Familiarity outweighs the self-documentation benefit of named keys. | ||
|
|
||
| ## Reference: Comparable Plugins | ||
|
|
||
| | Plugin | Config mechanism | | ||
| |--------|-----------------| | ||
| | **lightline.vim** | `g:lightline = {'colorscheme': 'wombat'}` + palette dicts with `[fg, bg, ctermfg, ctermbg]` arrays | | ||
| | **vim-airline** | `g:airline_theme = 'gruvbox'` (named theme files in `autoload/airline/themes/`) | | ||
| | **buftabline** | `g:buftabline_indicators = 1` style flags; no color config (relies on existing `TabLine`/`TabLineSel` groups) | | ||
|
|
||
| tabs.vim sits between lightline (full palette control, many modes) and buftabline (no control). The chosen approach borrows lightline's array format but without a named-theme layer — appropriate for a focused plugin with only six mode colors. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - `g:tabs_vim_colors` is the single configuration point for all mode colors | ||
| - The plugin applies `hi` statements from the merged dict (user overrides + defaults) at load time | ||
| - If a user sets `TabsVim_*` highlight groups themselves *after* the plugin loads, those are respected as-is (plugin does not re-apply on colorscheme change in this phase) | ||
| - Phase 4 (Polish) may add `ColorScheme` autocmd re-application, but that is out of scope here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.