Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On other distros I have run, vim remembers your command history even between sessions; this is especially handy when doing a lot of similar operations on different files.

For some reason, it has been flushing in Ubuntu 12.04, and I can't figure out why. Here is my :set info:

--- Options ---
  background=dark     helplang=en         history=1000      nomodeline   scroll=27           showmatch           ttyfast
  expandtab           hidden              incsearch           ruler      showcmd             softtabstop=4       ttymouse=xterm2
share|improve this question
up vote 17 down vote accepted

Check presence and rights for ~/.viminfo. Usually that's it which keeps command history, file editing positions, etc. One possible case is that this file belongs to root.

share|improve this answer
It exists, but shows MYUSER:MYUSER; even so, it said permission denied when I tried to open it. Also, there is a ~/.viminfo.tmp – Bryan Agee Jul 14 '12 at 6:53
So, I closed all instances of Vim, sudo rm'd both of the above files, and viola--good to go. Thank you! – Bryan Agee Jul 14 '12 at 7:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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