Search code examples
vimterminaleditoriterm

vim not showing me if I have modified the file


Suppose I open multiple tabs in vim, using tabnew. Now, if I modifiy a file in any of the tabs, vim shows me that I have modified the file by placing a + in front of the tab's title, which happens to be the file's name.

However, when I am editing a single file in vim in iTerm, then I don't see any visual indication to tell me that I have modified the file. Is there a way to get a visual indicator here just like when I open the file in a tab?


Solution

  • Try :set laststatus=2 (see :help status-line for details). Vim shows the "file modified" status in the status line by default. If you don't see it in the status line check statusline variable. Probably :set statusline+=%m will be sufficient (see :help 'statusline').