Skip to content

Remove trailing white spaces on the changed lines #413

@fenghse

Description

@fenghse

I am switching from vim-gitgutter to this new plugin, it is fast! Thanks.

But I am relying on following function to remove the trailing white spaces on the new added lines.

function! GlobalChangedLinesGutter(ex_cmd)
  for hunk in GitGutterGetHunks()
    for lnum in range(hunk[2], hunk[2]+hunk[3]-1)
      let cursor = getcurpos()
      silent! execute lnum.a:ex_cmd
      call setpos('.', cursor)
    endfor
  endfor
endfunction

command! -nargs=1 Glines call GlobalChangedLinesGutter(<q-args>)
autocmd BufWritePre * :Glines s/\s\+$//e

Is there equivalent API available from vim-signify to support this? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions