Skip to content
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

Doesn't work for *.conf filetypes (and maybe others?) #9

Closed
filipekiss opened this issue Oct 18, 2019 · 6 comments · Fixed by #10
Closed

Doesn't work for *.conf filetypes (and maybe others?) #9

filipekiss opened this issue Oct 18, 2019 · 6 comments · Fixed by #10
Labels

Comments

@filipekiss
Copy link
Contributor

filipekiss commented Oct 18, 2019

I installed your plugin and was working with a *.conf file and noticed the colors weren't working. I thought I was messing the configuration, but it works when I'm on a *.sass file. Here's a gist with both files and a minimal.vimrc for reproduction.

Great plugin, btw!

Sass File Conf File
image image
@norcalli
Copy link
Owner

norcalli commented Oct 18, 2019

I can confirm this problem! I have no idea why, yet, though, but I'm working on another few issues, so I'll try to address it very soon. And thanks :)

@norcalli norcalli added the bug Something isn't working label Oct 18, 2019
@filipekiss
Copy link
Contributor Author

filipekiss commented Oct 18, 2019

@norcalli I think I found out the problem: The .conf file has no filetype in vim. If you set ft=conf the colors come up as if magic!

--- edit ---

I think this is not colorizer fault, but maybe we can add the information on the README that won't work for buffers without filetype? (since the AutoCmds won't be run)

@norcalli
Copy link
Owner

The problem probably originates in the FileType autocmd [EDIT: as you just mentioned, haha].

The setup function is just a thin wrapper around calling colorizer.attach_to_buffer().

If you do :lua require'colorizer'.attach_to_buffer(0), it will highlight the current buffer.

You can use this with options too (as the second parameter). In the meantime, it would seem that making an autocmd for BufReadPost *.conf setl ft=conf would work.

@filipekiss
Copy link
Contributor Author

Yeah, adding the filetype solves the problem for me. Great plugin ♥️ Thank you so much!

@norcalli
Copy link
Owner

@filipekiss yeah, adding it to the README is a good idea. I'll keep this issue open for now for future travelers.

@norcalli norcalli added notmybug and removed bug Something isn't working labels Oct 18, 2019
filipekiss added a commit to filipekiss/nvim-colorizer.lua that referenced this issue Oct 18, 2019
@filipekiss
Copy link
Contributor Author

Made a pull-request with the information. :D Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants