mhinz / mhinz/vim-signify

Remove trailing white spaces on the changed lines

Open
#413 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
2.7k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

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()
autocmd BufWritePre * :Glines s/\s\+$//e
```

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

Contributor guide

Open the contributing guide

Research direction

Start by reading the GlobalChangedLinesGutter function and the BufWritePre autocmd in the issue, then inspect vim-signify's available changed-line APIs. Done means documenting or exposing an equivalent way to apply an Ex command to newly added lines, with the trailing-whitespace example working.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.