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

Some feature requests #52

Closed
numToStr opened this issue Feb 9, 2021 · 6 comments
Closed

Some feature requests #52

numToStr opened this issue Feb 9, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@numToStr
Copy link
Contributor

numToStr commented Feb 9, 2021

Thanks for making this plugin ❤️ . It is awesome and fast like really fast.

Is your feature request related to a problem? Please describe.
Currently, by default, signcolumn background is highlighted. Which attracts too much attention. I was able to disable that but now the text is white and I am not able to find any option to highlight the text.

My config

require('gitsigns').setup({
    signs = {
        add          = {hl = 'NONE', text = '+'},
        change       = {hl = 'NONE', text = '~'},
        delete       = {hl = 'NONE', text = '_'},
        topdelete    = {hl = 'NONE', text = ''},
        changedelete = {hl = 'NONE', text = '!'},
   }
})

What it looks like
image

I am migrating from gitgutter and I like its signs better.

Describe the solution you'd like

  1. Option to disable bg highlight like numhl
  2. Option to highlight text
  3. Maybe an option to flip between bg and text highlight.
@numToStr numToStr added the enhancement New feature or request label Feb 9, 2021
@lewis6991
Copy link
Owner

  1. numhl is disabled by default and when enabled the highlights it uses are fully configurable; you just need to define the highlights.
  2. We can do this and should be easy to implement since sign define has a linehl option.
  3. Again I'm not sure what you mean by this. Gitsigns allows you to specify the highlights to use for specific signs so you can define them how you like.

Thanks for the feedback and hopefully I haven't misunderstood your requests.

@lewis6991
Copy link
Owner

One tip is that you can run the :highlight command which should list all the defined highlights in your nvim. From this list you can pick out highlights you would like to use for each of the signs. This saves having to define the highlights manually. For example my colourscheme (moonlight.vim) defines the highlights GitGutterAdd, GitGutterChange and GitGutterDelete therefore I have my gitsigns config as:

        signs = {
          add          = {hl = 'GitGutterAdd'   },
          change       = {hl = 'GitGutterChange'},
          delete       = {hl = 'GitGutterDelete'},
          topdelete    = {hl = 'GitGutterDelete'},
          changedelete = {hl = 'GitGutterChange'},
        }

Which gives me the same sign highlights that I would get if I used gitgutter (which I used to use).

@numToStr
Copy link
Contributor Author

@lewis6991 Thanks for the quick reply. GitGutter* highlights is what I wanted as my theme also defines that.

Just to be clear, In 3 point what I wanted was rather depending on another highlight group. gitsigns can provide an option to apply default highlights on the fg rather than bg. It will give the user a nice option to change the behavior rather than define highlight on the individual state.

Something like this.

require("gitsigns").setup(
    {
        highlight_text = true -- Apply highlights to the text rather than backgroud
    }
)

Maybe I am asking too much

@lewis6991
Copy link
Owner

lewis6991 commented Mar 4, 2021

Sorry about the delay.

Just to be clear, In 3 point what I wanted was rather depending on another highlight group. gitsigns can provide an option to apply default highlights on the fg rather than bg. It will give the user a nice option to change the behavior rather than define highlight on the individual state.

Gitsigns doesn't apply highlights specifically on the fg or the bg, it just applies the highlight as fg and bg are both apart of the highlight. If you want to inverse the color of a highlight group so fg<->bg then just add reverse or inverse to the highlight group (see :help inverse.

@lewis6991
Copy link
Owner

Line highlighting is now implemented. Could we now close this issue? Let me know if you need any help with setting up highlights 🙂

@numToStr
Copy link
Contributor Author

numToStr commented Mar 6, 2021

Yeah sure.

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

No branches or pull requests

2 participants