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?
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
I have written the StatusLineHighlight plugin for that. It changes the color of the statusline to red (customizable) for modified buffers.
It won't work together with Powerline or other fancy statusline modifications, though.
It is not the answer to the question you asked, but why don’t you just do
set autowrite
to make the problem you mentioned (“go back to the terminal and execute the script I'm writing… only to realize that I haven't written it to disk yet”) go away: this option makes vim save changes you did when you suspend it (note: not when you use :shell
to spawn a new shell).
For powerline the only thing you can do easily is to edit colorscheme to make more noticeable highlighting: copy autoload/Powerline/Colorschemes/default.vim
to ~/.vim/autoload/Powerline/Colorschemes/my.vim
, find Pl#Hi#Segments(['fileinfo.flags'
and in each line add the second color (background one): transform ['brightestred', ['bold']]
to ['white', 'brightestred', ['bold']]
and so on. Then add
let g:Powerline_colorscheme='my'
to the vimrc and run :PowerlineClearCache
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With