Vimscript check if current buffer has unsaved changes

前端 未结 2 1920
忘掉有多难
忘掉有多难 2021-02-13 06:20

I currently have my status line set up so that it\'s orange in insert mode and white otherwise. I\'d like to make it go another color when I drop back to normal mode if the file

相关标签:
2条回答
  • 2021-02-13 06:55

    I like the idea of using the statusline color to indicate the buffer state. In fact, I've written the StatusLineHighlight plugin, which indicates the following attributes: modified, readonly, unmodifiable, special non-file "scratch" (but not the insert mode that you're using; for that, I find Vim's mode indication in the lower left corner enough).

    0 讨论(0)
  • 2021-02-13 07:09

    I think that you are looking for

    :echo &mod[ified]
    

    which returns 1 if modified and 0 if not modified.

    0 讨论(0)
提交回复
热议问题