Is it possible to have Vim highlight the changed lines since the last save? I know it can be done with version control, but can it be done without? I do not want to use any version control system, because the code I work on does not have that.
I think, UltraEdit has something like that.
With the default backslash leader key, pressing \l will highlight the line that currently contains the cursor. The mapping also sets mark l so you can type 'l to return to the highlighted line.
Since switching back to the previous file is something that tends to happen a lot, you don't have to move to the ex command line to do it. The vi command ^^ (the "control" key with the caret key) will do this for you. Using this command is the same as typing :e #.
Straight from Vim documentation (see :help :DiffOrig
):
if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis endif
Then just do :DiffOrig
et voila!
From Vim Wiki:
Type :changes
to display lines where changes occurred.
Use g;
and g,
to jump to changed lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With