8

Is there a command or plugin that I can use to show all the lines I have edited in a Vim session? I would like to be able to have all the changes I have made highlighted when working in co-workers projects and lost in lines of code.

  • maybe you could use vimdiff with a backup of the original and perhaps just hide the window showing the original? I don't know if that will work but it may be worth taking a look. – jw013 Sep 22 '11 at 19:10
3

The changesPlugin seems to work just fine for this type of thing.

http://www.vim.org/scripts/script.php?script_id=3052

Once installed, just run :EC after making changes to a file.

7

I would suggest using a revision control system, such as CVS, Mercurial or Subversion (etc.). These all come with the ability to compare the working copy of a file with whatever was last checked into the repository by you or your co-workers.

  • I always have such a hard time forming these technical questions. I want it so as I am editing a file I can tell what I have added in that session. – Arcabard Sep 22 '11 at 19:05
  • 2
    @James, try the :changes command in Vim to see if it's doing what you want it to do. – Kusalananda Sep 22 '11 at 19:10
  • I realized later that I could just work out of GIT diff to get what I wanted. TY for pointing out to me the obvious solution. Some times I just don`t think. – Arcabard Oct 4 '11 at 14:53
  • For coding that is fine, but I'm often editing config files on a remote server and they are generally not under source control (and the incremental backups don't have an easy compare function ;) – Hamish Downer Oct 30 '11 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.