1

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?

user2048925
  • 63
  • 1
  • 5

1 Answers1

3

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').

Ves
  • 1,212
  • 1
  • 9
  • 19
  • `set laststatus=2` put a status bar at the bottom of vim. But, when I modified the file, the status did not change. I was expecting that it would put a `+` in front of the filename in the status bar. But it did not. – user2048925 Oct 29 '16 at 17:01
  • 1
    @user2048925 Almost there, just read the [`:help statusline`](http://vimhelp.appspot.com/options.txt.html#%27statusline%27). Try to `set statusline=%m%f)`. – ryuichiro Oct 30 '16 at 17:23
  • @user2048925 can you show output of `:verbose set statusline?` please? – Ves Oct 31 '16 at 13:42