0

In both the plugins I use for Vim and neovim statuslines, an indicator shows that the file has been changed since it was last saved. It looks like this on one of them after the current buffer filename: [+]. I think it's handy to show where you started when repeatedly undoing changes with u.

I don't use a statusline plugin on gVim as I prefer to keep it as plain-looking as possible, but I keep missing that indicator. Is there a function that I can use to add it?

This is my current statusline gVim configuration:

set statusline=
set statusline+=%f
set statusline+=%=
set statusline+=%l:%c\ \ %p%%
hi StatusLine guibg=grey70 guifg=#eeeeee
4
  • You didn't read :help 'statusline' far enough.
    – romainl
    Jun 13 at 13:54
  • Showing [+] as indicator for modified buffer is default behavior. If you "prefer to keep it as plain-looking as possible," just don't :set statusline at all.
    – Friedrich
    Jun 13 at 16:54
  • @Friedrich I just tried removing them and then I lost the row, column and scroll percentage%. It was a while back when I set them but now I know why I did it. I just overlooked this indicator. They are in a very light colour that is barely visible.
    – paradroid
    Jun 13 at 23:38
  • @paradroid leaving the statusline option on its default value (i.e. empty) gives me all the information I want to see. This includes line, column and percentage (0% is rendered as "Top"). It's your statusline so set it to whatever makes you happy :)
    – Friedrich
    Jun 14 at 6:24

1 Answer 1

0

Pointer in the comments led me to add this after the filename and it does exactly what I wanted. The \ is to add a space between the filename and the indicator.

set statusline+=\ %m
1
  • 1
    I think only \ %m is needed
    – D. Ben Knoble
    Jun 13 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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