Saturday, December 15, 2012

Oops! i closed my terminal

This is just what happened at a customer's site a few days ago. I was debugging remotely from my office and had finally nailed down a problem's root cause. The source code which was causing the problem was opened in vim in a terminal, and some edits were made before closing it. Later in the day someone else mistakenly closed the terminal, and we badly needed to know which file we had opened! We couldn't find out by searching for the change we made, because the files were distributed all over the customer's network. I was about to start debugging again -- this time just to find out the file name. When all of a sudden I remembered that vim stores details of the last few locations it edited in the ~/.viminfo file. I opened it and there it was, one of the most recent entries. Problem solved!
The next day in office I looked for where emacs stores such info, since I am an emacs user. I found it in ~/.emacs.d/history . So the next time you need to find your last few opened files in vim/emacs you know where to look for.

No comments:

Post a Comment