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

How to change the highlight color for indent line of the current context ? #765

Closed
adamency opened this issue Nov 4, 2023 · 3 comments
Closed

Comments

@adamency
Copy link

adamency commented Nov 4, 2023

I can't find the relevant information on this in the doc as all mentions of the word "context" have been removed since v3 as I can see in the commit history, and all the issues mentioning the current context are from before v3 and thus use the word "context". Consequently, I didn't manage to find the replacement for settings about the current context. Can you point me to the correct setting for this ?

PS: Basically I would like to have the same pink color you have in your screenshots for the current context but configuring with the suggested configuration from the readme gets me a grey indent line, which IIUC is a color from my colorscheme (seems to be the comment highlight), but I would like to override it for the indent line of the current context.

tmp

@Danielkonge
Copy link
Contributor

This is not yet in the main code, but it is being worked on in #743. When that pull request is committed, you will be able to find docs about it by searching the docs for current_indent instead of context.

I have been using it for more than a week now with the changes I suggested there, and I haven't had any problems. If you want to test it out, you could use the current_indent code too by using the current-indent branch (and possibly make the suggested changes if you run into any of the edge cases in the current code).

Also there is already an issue about this: #649

@adamency
Copy link
Author

adamency commented Nov 4, 2023

@Danielkonge Thanks a lot for your detailed answer. I had already found both that open PR and your issue.

However, that's not what I'm talking about nor what I was looking for. In the meantime I have found the solution to my issue. What I wanted is actually already (or rather still) available but the config key name is not very explicit...

Here is the code I had to add:

-- in HIGHLIGHT_SETUP hook
  vim.api.nvim_set_hl(0, 'CurrentScope', { fg = "#fc5ef3" })
-- in setup{}
  scope = { highlight = 'CurrentScope' },

I then can have the current context/scope highlighted differently from the default highlights per indentation levels:

tmp

@adamency adamency closed this as completed Nov 4, 2023
@Danielkonge
Copy link
Contributor

Ah, I guess I was confused by you saying context and your cursor position in the picture, since multiple people have asked similar questions with current_indent in mind.

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

No branches or pull requests

2 participants