How do I determine whether the current buffer is modified or not?

You can check the value of the ‘modified’ option to determine whether the current buffer is modified:

    :set modified?

From a Vim script, you can check the value of the ‘modified’ option:

    if &modified

        echo "File is modified"

    endif

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind