lifepillar / vim-gruvbox8

A simplified and optimized Gruvbox colorscheme for Vim
528 stars 49 forks source link

issues when re-generating the color scheme #61

Open mahush opened 1 month ago

mahush commented 1 month ago

Hey there, thanks for this version of the gruvbox color scheme, I like the improvements you introduced!

So I wanted to build on this to adapt the background colors to my taste. Unfortunately re-generating the color scheme after adjusting the template files did not work for me. The issue is that vim-gruvbox8 already relies on v3 but I am failing to resolve the dependencies to vim-devel.

Which version of vim-devel is compatible?

Or what would be a straightforward approach to regenerate the scheme?

lifepillar commented 1 month ago

vim-devel's main branch is fine, but for that you need Vim 9.1.0547 or later. You may checkout an older commit, though: any commit earlier than edcbed0a06b497bd5d969b42b71579ca5acad605 and later than Feb 2024 should be fine to use Colortemplate v3. You will still need a fairly recent version of Vim (probably Vim 9.0.2185 or later). Please check that your Vim is recent enough.

This should get you up and running:

git clone https://github.com/lifepillar/vim-devel.git ~/.vim/pack/devel
cd ~/.vim/pack/devel
git checkout 1bd7845610128ba074064237fe20dcb01c567d41
git clone https://github.com/lifepillar/vim-colortemplate.git ~/.vim/pack/plugins/start/colortemplate
cd ~/.vim/pack/plugins/start/colortemplate
git checkout v3

If you still can't get it working, please post more details including your Vim version and the errors you get.

mahush commented 1 month ago

Thanks @lifepillar for coming back to me!

I tried again. I am using vim 9.0.749, so I tried the approach with the older devel commit. Unfortunately, it is still not working. When I execute :set ft=colortemplate, I get the following error:

Error detected while processing FileType Autocommands for "*"..function <SNR>12_LoadFTPlugin[18]..script /home/matthias/dotfiles-vim/.vim/pack/color/opt/vim-colortemplate/ftplug
in/colortemplate.vim[41]..function InitOutputDir[14]..script /home/matthias/dotfiles-vim/.vim/pack/color/opt/vim-colortemplate/autoload/v3/colortemplate.vim[4]../home/matthias/d
otfiles-vim/.vim/pack/devel/start/libparser/import/libparser.vim:
line    9:
E319: Sorry, the command is not available in this version: export class Context
Error detected while processing FileType Autocommands for "*"..function <SNR>12_LoadFTPlugin[18]..script /home/matthias/dotfiles-vim/.vim/pack/color/opt/vim-colortemplate/ftplug
in/colortemplate.vim[41]..function InitOutputDir:
line   14:
E117: Unknown function: v3#colortemplate#SetOutputDir

Interestingly executing the same command a second time seems to work (no error message and syntax highlighting is shown for the template file).

Either way, after the first failed, or the second successful call, when executing :Colortemplate ~/.vim afterwards in order to re-generate the color scheme, I get E488: Trailing characters: ~/.vim.

Of course, I added following lines to my vimrc:

packadd! gruvbox8
packadd! vim-devel
packadd! vim-colortemplate
packadd! vim9asm

Does this make any sense? Happy to receive further help ;-)

lifepillar commented 4 weeks ago

Sorry for the late reply, life's sometimes gets in the way. I'm afraid your version of Vim is too old. Looking at :help vim9-classes from Vim 9.0.749, it says:

Above "class" was mentioned a few times, but it has not been implemented yet. Most of Vim9 script can be created without this functionality, and since implementing classes is going to be a lot of work, it is left for the future.

But support for classes is required both by vim-devel and by Colortemplate v3.

I've pushed a change to vim-devel to improve backward compatibility, but after playing a bit with various Vim releases, I've found that Colortemplate v3 works with Vim 9.1.0 or later, but not with Vim up to v9.0.2190 (the last patch of v9.0).

So, to summarize, this combination of versions works for me:

Sorry for the misleading instructions I've posted above. On the positive side, building Vim from source should be fairly easy. I do this to build Vim's master:

git clone https://github.com/vim/vim.git
cd vim
./configure
# Or, if you need to pass flags, something like this:
# env CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure --prefix=/opt/local
make -j9 VIMRUNTIMEDIR=`pwd`/runtime

And then I run it from ./src/vim (without installing it in my PATH).

packadd! vim9asm

This is not needed by Colortemplate (but it's a nice development plugin!).

mahush commented 4 weeks ago

Thanks a lot @lifepillar for taking the time to provide that valuable answer! I will try again with an updated vim soon 🚀