Skip to content

Use lifepillar/vim-colortemplate/ refact the repo#30

Open
mao-yining wants to merge 4 commits into
catppuccin:mainfrom
mao-yining:template
Open

Use lifepillar/vim-colortemplate/ refact the repo#30
mao-yining wants to merge 4 commits into
catppuccin:mainfrom
mao-yining:template

Conversation

@mao-yining

Copy link
Copy Markdown

Update with latest nvim's repo.

make some changes. waiting for catppuccin/nvim#940

@M3nny

M3nny commented Oct 11, 2025

Copy link
Copy Markdown
Member

You're doing a lot of work in order to put catppuccin in the vim colorscheme repository, and i appreciate it.
But could you explain the changes that you've made? in particular:

  • What do the catppuccin.vim files do?
  • Why there was a need to rewrite everything with vim-colortemplate? This seems unnecessary.

@M3nny M3nny self-requested a review October 11, 2025 16:43
@mao-yining

Copy link
Copy Markdown
Author

What do the catppuccin.vim files do?

provide mocha when background=dark and latte when it's light. and if you change 'background' it can change automatically.

Why there was a need to rewrite everything with vim-colortemplate? This seems unnecessary.

The present implement use vim lagacy function, it is a bit slow. And I hope to use it in 256color environment.

Furthermore, it can use one file to define all highlights and links. It is like what nvim's repo do now. So that if you want to have a change which should be added in all four themes, you only need to change once.

@M3nny

M3nny commented Oct 11, 2025

Copy link
Copy Markdown
Member

The present implement use vim lagacy function, it is a bit slow. And I hope to use it in 256color environment.

The cost for calling the function for setting the colorgroups is negligible, and it already works with truecolors.

Have you considered using our internal tool whiskers?

@mao-yining

Copy link
Copy Markdown
Author

The present implement use vim lagacy function, it is a bit slow. And I hope to use it in 256color environment.

The cost for calling the function for setting the colorgroups is negligible, and it already works with truecolors.

Have you considered using our internal tool whiskers?

Maybe I will try it in the future. It seems a bit complex. Time is late. I may try it tomorrow

@mao-yining

mao-yining commented Oct 31, 2025

Copy link
Copy Markdown
Author

I've briefly reviewed the introduction of whiskers. Here are my thoughts:

If I understand correctly, its operational model involves generating files by filling in blanks within configuration templates based on preset options.

Its primary advantage over vim-colortemplate lies in the convenient fine-tuning of colors, such as {{ green | mod(opacity=0.3) | get(key="hex") }}.

However, I believe vim-colortemplate is superior for the following reasons:

Although I'm aware that Catppuccin is specifically designed for GUI true color, Vim, being a software with significant historical legacy, requires its plugins—including this project—to support 256 colors (disregarding 16-color support for now). This is because the colors automatically generated by Vim for GUI are not entirely accurate.

There's no need to account for logic based on options like 'background', etc., which would lead to redundant workload. The current vim-colortemplate is much simpler in this regard.

The primary reason is that Vim's color configuration files differ from standard formats like JSON or YAML, leaning more towards being a programming language where all the switching logic is pre-written internally.

@M3nny

M3nny commented Oct 31, 2025

Copy link
Copy Markdown
Member

Since you're already creating a "legacy" port in the vim colorscheme repository, maybe we can use this repository as a "modern" version.

So in the future if more plugins will be added, we can use the same approach for every part of the colorscheme, without having a part done in vim-colortemplate and others in whiskers

@mao-yining

mao-yining commented Oct 31, 2025

Copy link
Copy Markdown
Author

Well, my main point is that I believe we could maintain a file that automatically switches based on the value of background. Whiskers' setup seems better suited for maintaining a single-color scheme file — though it's also possible that I haven't fully grasped how Whiskers works yet.

@mao-yining mao-yining force-pushed the template branch 2 times, most recently from 1c1720a to e5d7a35 Compare November 15, 2025 06:57
@mao-yining mao-yining marked this pull request as ready for review November 15, 2025 06:58
@mao-yining

Copy link
Copy Markdown
Author

Seems this is a complete version. Request for review and merge.

Updates will be provided should any changes arise.

@mao-yining mao-yining force-pushed the template branch 8 times, most recently from 41b25e4 to 9f9a201 Compare January 3, 2026 11:24
@mao-yining mao-yining force-pushed the template branch 2 times, most recently from ccaa15d to 9f9a201 Compare January 9, 2026 15:24
@mao-yining mao-yining force-pushed the template branch 3 times, most recently from c351a9d to 0f08f5e Compare January 23, 2026 08:48
@mao-yining

mao-yining commented Jan 23, 2026

Copy link
Copy Markdown
Author

@M3nny vim/colorschemes#286 has done, however this PR is NOT completely as catppuccin/neovim is. If you have some different idea with these changes. Please directly point it out.

@mao-yining mao-yining force-pushed the template branch 2 times, most recently from 9f9a201 to 0f08f5e Compare January 23, 2026 15:50
@mao-yining

mao-yining commented May 22, 2026

Copy link
Copy Markdown
Author

@M3nny Hello, I would like to ask how you are considering this PR.

I have made some experimental improvements in my own repository and was wondering whether you can take them into consideration.

@M3nny

M3nny commented May 24, 2026

Copy link
Copy Markdown
Member

@mao-yining I've taken a look at the changes, and I've also seen that you've managed to get catppuccin into the official vim colorschemes, nice job!

However, before merging this PR, there are a few (minor) issues regarding the code layout that need to be addressed:

  • Plugin colortemplate groups should not be stored in a single file, perhaps a subfolder like colortemplate/groups/plugins would be better than having them all inside extra
  • Make sure the "last change" in the headers is written in English
  • The colortemplate/README.txt should be a markdown file, without the vim modeline at the end, and it should explain how to use colortemplate to generate the color files

@mao-yining

mao-yining commented May 29, 2026

Copy link
Copy Markdown
Author

Make sure the "last change" in the headers is written in English
The colortemplate/README.txt should be a markdown file, without the vim modeline at the end, and it should explain how to use colortemplate to generate the color files

Have done.

Plugin colortemplate groups should not be stored in a single file, perhaps a subfolder like colortemplate/groups/plugins would be better than having them all inside extra

Colortemplate does not support Include: foo/* so I have to include them seperately in init.vim. Do you think that is fine?


By the way, I have made some other changes in these month:

  1. VertsplitNC which is newly added in Vim9, which will change the view and require vim9.
  2. Popup and others, which is newly added in Vim9.

For these features are added in vim9 and if we use vim9script in color/*.vim will have a better performance. I directly generate vim9 scripts.

@M3nny

Update with latest nvim's repo. Add support for 265 16 and 8 colors.

These files are color templates for each palette, used to generate color
scheme files in colors/*.vim.

Use lifepillar/vim-colortemplate to build colorschemes from templates.

Files descriptions:

groups/init                        Load all groups
groups/terminal                    Terminal colors
groups/editor                      Highlight group settings and links for Vim's internal settings
groups/extra                       Highlight group settings and links for plugin support
palettes/frappe                    Frappe palette
palettes/latte                     Latte palette
palettes/macchiato                 Macchiato palette
palettes/mocha                     Mocha palette
catppuccin.colortemplate           Colortemplate for both light and dark backgrounds
catppuccin_frappe.colortemplate    Colortemplate for Frappe (single palette)
catppuccin_latte.colortemplate     Colortemplate for Latte (single palette)
catppuccin_macchiato.colortemplate Colortemplate for Macchiato (single palette)
catppuccin_mocha.colortemplate     Colortemplate for Mocha (single palette)

Here is the log of changes that rebased:

- fix: CurSearch is not well under Visual
- fix: Todo is not clear when diff
- Update cterm color mappings for Catppuccin theme
- Turn QuickFixLine in mauve
- Fix: diff, visual and statuslinenc problem
- Fix: QuickFixLine and MatchParen
- Add support for 8 colors
- Surface1 white 256
- Draft of 16 color implement
- Finish in 256
- Fix: Diff* in 256
- Fix: Spell* in term
- Fix: StatusLineNC in 256
- Remove support for plugins
- Style change
- Add: PmenuMatchSel/PmenuMatch
- rebase: master and style
- Add TitleBar and TitleBarNC
- style: noexpandtab
- feat: ALEVirtualText
- Add: LspDiag
- style: reset cc
- Add hl-dirMark
- Fix: QuickFixLine is same as Visual
- Use colortemplate regenerate 256 color
- Disable MatchParen's Background Colour
- Set lCursor Specially
- Fix: PmenuExtra
- Reverse Todo's Highlight
- Add Added/Changed/Removed
- Avoid use italic
- Add some lacked highlights
- Remake Spells' Highlight
- Add Catppuccin Theme in Draft
- Use colortemplate regenerate 256 color
- Disable MatchParen's Background Colour
- Set lCursor Specially
- Fix: PmenuExtra
- Reverse Todo's Highlight
- Add Added/Changed/Removed
- Avoid use italic
- Add some lacked highlights
- Update according to catppuccin/nvim
- Remake Spells' Highlight
- Add Catppuccin Theme in Draft

Signed-off-by: Mao-Yining <mao.yining@outlook.com>
@M3nny

M3nny commented Jun 8, 2026

Copy link
Copy Markdown
Member

I mean, it is a colorscheme, i don't think switching to vim9 colors will make the users feel the difference, anyway we could do that, but it should be stated in the README at the root of the repo, since it currently states that vim8 is required, and it might be misleading.

Then airline single-flavor files (autoload/airline/themes/catppuccin_<flavor> should reference their palettes, so:

- let g:airline#themes#catppuccin_<flavor>#palette.terminal = copy(g:airline#themes#catppuccin#palette.insert)
+ let g:airline#themes#catppuccin_<flavor>#palette.terminal = copy(g:airline#themes#catppuccin_<flavor>#palette.insert)

This should be done for the four color variants.

Another thing, it would be better to move the background evaluation (if &background == 'dark' ... endif) in airline/themes/catppuccin.vim inside of the refresh() method, in this way it is correctly updated on background change.

@mao-yining

Copy link
Copy Markdown
Author

Another thing, it would be better to move the background evaluation (if &background == 'dark' ... endif) in airline/themes/catppuccin.vim inside of the refresh() method, in this way it is correctly updated on background change.

In fact airline will automatically reread that file. Anyway it is a better "refresh".

Then airline single-flavor files (autoload/airline/themes/catppuccin_ should reference their palettes, so:

DONE.

It should be stated in the README at the root of the repo.

DONE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants