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

My colorscheme is incorrect on Go syntax. #245

Open
hoenirvili opened this issue Feb 6, 2021 · 12 comments · May be fixed by #246
Open

My colorscheme is incorrect on Go syntax. #245

hoenirvili opened this issue Feb 6, 2021 · 12 comments · May be fixed by #246

Comments

@hoenirvili
Copy link

So I tried using nord as my colorscheme in neovim but some colors are not consistent with the screenshot. I'm using linux manjaro, neovim (NVIM v0.5.0-dev+1062-gcc1851c9f)

I've added arrows to illustrate where is the problem.

Mine

image

How it should be

image

if exists('+termguicolors')
	let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
	let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
	set termguicolors
endif
colorscheme nord

...

" go syntax color bs
let g:go_highlight_methods = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_operators = 1
let g:go_highlight_types = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_generate_tags = 1
let g:go_highlight_format_strings = 1
@hoenirvili hoenirvili changed the title My colorscheme is incorrect on go syntax. My colorscheme is incorrect on Go syntax. Feb 6, 2021
@arcticicestudio
Copy link
Contributor

Hi @hoenirvili 👋🏼
Looks like this is the same problem like reported and resolved in #203. Could you please try the suggestions I've posted there?

@hoenirvili
Copy link
Author

hoenirvili commented Feb 7, 2021

Hi @arcticicestudio.

I've just copy-pasted everything from that comment you suggested and I commented on all of my previous settings. It still does not look like in the picture. I'm wondering if this is an issue on Linux because a couple of years ago I was using the same setup with neovim on my mac using iterm2 and I didn't have any problem.

image

image

@arcticicestudio
Copy link
Contributor

Have you also tried to use vimgo instead of vim-go?
Under the hood it simply makes use of the official editor tool gopls which natively understands Go while vim-go makes use of the common Vim approach by using regular expressions to tokenize the syntax elements.
All these options are part of the vim-go plugin while vimgo should work out-of-the-box™️. I know that this naming is kind of confusing, but that's kind of normal when things evolve 😄

@hoenirvili
Copy link
Author

Have you also tried to use vimgo instead of vim-go?

No, but looks like vimgo which is govim only supports vim8. I'm using neovim and I want to use still neovim. I'll try using govim with my neovim and see if that does make a difference.

BTW for using gopls LSP protocol I'm using coc-vim and I just disable the whole lsp options in vim-go. Because in reality I only need just a small number of features like running gofmt + goimports/goreturns but maybe I should use prettify or something from the coc marketplace.

@hoenirvili
Copy link
Author

hoenirvili commented Feb 7, 2021

Looks like it doesn't even let me load govim in a neovim instance.

I would rewrite/hardcore color changes myself but I don't know where to start or which colors are used and I don't have that much experience writing vimscript.

It's there a possibility that this can be solved somehow by Nord ?

@hoenirvili
Copy link
Author

hoenirvili commented Feb 7, 2021

I'm back with an update. After searching some time I've come up with a solution but IDK how good it is.

This fixes the format string, the function call but I still have to figure out now the ; and the ".

"vim-go syntax highlighting bs
let g:go_highlight_operators = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_generate_tags = 1

highlight goFunctionCall guifg=#88C0D0
highlight goFormatSpecifier guifg=#EBCB8B
highlight goEscapeOctal guifg=#EBCB8B                 
highlight goEscapeC guifg=#EBCB8B
highlight goEscapeX guifg=#EBCB8B
highlight goEscapeU guifg=#EBCB8B     
highlight goEscapeBigU guifg=#EBCB8B           
highlight goEscapeError guifg=#EBCB8B

Further investigation

Looks like these are the color assign to these variables or IDK what is this in vim.

s:nord13_gui => #EBCB8B
s:s:nord8_gui => #88C0D0

I tried setting things like this

highlight goFunctionCall guifg=s:s:nord8_gui
highlight goFormatSpecifier guifg=s:nord13_gui 
highlight goEscapeC guifg=s:nord13_gui
...

But this doesn't work. Now comes the question, (I did solve the rendering in Go, it's a hacky solution, but it works) if go syntax was broken, this mans that every syntax lang color is broken into a certain extent? What's your opinion on this?

Also in order to identify all the groups I used this.

This is how It looks now.

image

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Feb 7, 2021

Thanks for the investigation and feedback 👍🏼
Seems like vim-go got some interesting updates. The last time I checked the implementation most of the syntax highlighting groups were not public so they couldn't be used for themes.
Nord currently only supports two syntax groups, but we should definitely add all the ones that are public available now.

I'll move this issue into the backlog.

@hoenirvili
Copy link
Author

There are any chances that this will be solved in the near future?

@hoenirvili hoenirvili linked a pull request Feb 8, 2021 that will close this issue
@hoenirvili
Copy link
Author

I've taken matters in my own hands. Could you please @arcticicestudio check the PR?

@chengleqi
Copy link

Same here! Looking forward to the PR!

@hoenirvili
Copy link
Author

@chengleqi the pr is here still w8 for review.

@svengreb
Copy link
Member

svengreb commented Jun 4, 2023

Thank you for your patience! 🙏🏼
It‘s been a while since I had free time to focus more on Nord, and my open source projects in general, and invest time in this issue due to work-life balance.

I recently published the first “Northern Post — The state and roadmap of Nord“ announcement which includes all details about the plans and future of the Nord project, including the goal of catching up with the backlog. This issue is part of the backlog and therefore I want to triage and process it to get one step closer to a “clean state“. Read the announcement about reaching the “clean“ contribution triage state in Nord‘s discussions for more details about the goal.

Therefore it has been added to the queue in the central and single-source-of-truth project board that is also described in more detail in the roadmap announcement.


@hoenirvili Thanks again for your contribution! Your PR #246 will be added to the queue also later for further processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: queued
Development

Successfully merging a pull request may close this issue.

4 participants