Saturday, March 29, 2014

Re: Suggestion for vim -diff behavior change

@Justin: You are talking about do/dp, right?

Yep!

I'm motivated by using fugitive for partial commits. I've been burned a few times, so I really want to be careful. The auto-folding makes it harder to confirm. zo and zc are better then what I was doing (pretty much what was suggested, but using zi instead to open all the folds).

I've thought a bit about this, and I've come up with a partial workaround for my secondary request, keeping the markings around. Basically I've built a small compiler script to:

* makeprg runs git diff -U1 (or the equivalent diff command)
* errorformat parses out the file and line number.

The line number is "wrong" in that it's the prior line, but it's pretty close. I can do a quickfix list prior to resolution and use the QF list afterwards to verify the changes.

FWIW, I've become totally fascinated by QF in the last few week. For many years I've seen as something only for C programmers, but it's really **far** more useful, a generalized marking service, a little like ctags, but for almost anything. I've written a TAP compiler script, and found a compiler script to save and load arbitrary QF and LL lists. Other ideas, using QF to find and mark TODO's, or Documentation blocks. It seems much more generally useful and powerful then I'd understood.

To that end, I wish the errorformat parsing wasn't so arcane. My biggest current concern is that %s auto anchors. If it was more generalized, then the integration possibilities are much greater (example, grammar checkers). I realize that the suggested fix is "use an external sed/awk script" but that seems a fragile kludge.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: