Skip to content
Discussion options

You must be logged in to vote

Git grep hunks

opts = {
  picker = {
    sources = {
      git_grep_hunks = {
        supports_live = false,
        format = function(item, picker)
          local file_format = Snacks.picker.format.file(item, picker)
          vim.api.nvim_set_hl(0, 'SnacksPickerGitGrepLineNew', { link = 'Added' })
          vim.api.nvim_set_hl(0, 'SnacksPickerGitGrepLineOld', { link = 'Removed' })
          if item.sign == '+' then
            file_format[#file_format - 1][2] = 'SnacksPickerGitGrepLineNew'
          else
            file_format[#file_format - 1][2] = 'SnacksPickerGitGrepLineOld'
          end
          return file_format
        end,
        finder = function(_, ctx)
          local h…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@AlejandroSanchez90
Comment options

Comment options

You must be logged in to vote
3 replies
@AlejandroSanchez90
Comment options

@chuan2984
Comment options

@drowning-cat
Comment options

Answer selected by AlejandroSanchez90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants