Search code examples
vimstatusline

Changing vim's status line's "file modified" flag to be more noticeable


I do this all the time:

Edit a file, go back to the terminal and execute the script I'm writing… only to realize that I haven't written it to disk yet.

How do I make it so that vim is basically shouting at my eyes whenever the file is unwritten? That tiny [+] isn't good enough. Ideally, I'd like to either increase the number of red plusses being shown, or something more drastic.

FOR INSTANCE, I'm using powerline (purely in an attempt to get a more noticeable 'file has been modified' notifier). I think it'd be pretty great if the main colour at the bottom of the bar changed whenever the file has not been saved.

Any ideas?


Solution

  • You can set vim to display the file modified flag 5 times if you want.

    set statusline+=%m
    

    This adds it one time. Increase the number of "%m" to whatever number you want. Further explanations and tricks here: http://got-ravings.blogspot.co.at/2008/08/vim-pr0n-making-statuslines-that-own.html