Misterio77 / flavours

🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
MIT License
501 stars 29 forks source link

Escaping quotes and double-quotes #46

Closed heygsiri closed 2 years ago

heygsiri commented 2 years ago

I have a vimscript file that I would like to insert a color scheme to. Using the start and end parameters, I am experiencing difficulties as the character for comments in vimscript is ". Attempting to do such gives me this error:

Couldn't replace lines in "/home/siri/.config/nvim/colors.vim": Couldn't find starting string.

Escaping with / (i.e /") as in Rust or \ (i.e \") as in TOML gives me the same exact error. Using single quotes and not escaping ('") as in TOML does not work either.

For now, my solution is to use rewrite=true and store the color scheme in a separate file. However it would be more optimal for my use case if I can group airline and vim themes in the same file.

Misterio77 commented 2 years ago

I can't seem to reproduce this issue. Here's two minimal configs that work for me:

Using single quotes:

[[items]]
file = "~/.config/nvim/init.vim"
template = "vim"
start = '" Start flavours'
end = '" End flavours'

Escaping the double quotes:

[[items]]
file = "~/.config/nvim/init.vim"
template = "vim"
start = "\" Start flavours"
end = "\" End flavours"

The init.vim file looks like this:

" Start flavours
" End flavours
...
heygsiri commented 2 years ago

Thanks, this has been proven to be a PEBCAK issue.

My init.vim had something like

" Start flavours
" End flavours

But my config.toml had

start = '"Start flavours'
end = '"End flavours'

If looked at closely, one can see the whitespace that causes flavours to not recognize the string.

This is something that can be covered briefly in the documentation. I declare this issue solved and will therefore close it.