Loading ...
Sorry, an error occurred while loading the content.

determining if buffer is modified.. etc

Expand Messages
  • Normandie Azucena
    hi all! I need to know if a certain buffer is modified. how can I do this? also can I disable the prompt that says that buffer or file has changed and gives me
    Message 1 of 4 , Apr 29, 2007
    • 0 Attachment
      hi all!

      I need to know if a certain buffer is modified. how can I do this?

      also can I disable the prompt that says that buffer or file has changed
      and gives me an option to load the new file or not? because I want vim
      to automatically load changed files at certain times(i.e. when I invoke
      a certain function that automatically change the contents of the files)

      tnx!

      normandie
    • Yakov Lerner
      ... if &modified | echo buffer is modified | endif ... Add exclamation mark to the command Yakov
      Message 2 of 4 , Apr 29, 2007
      • 0 Attachment
        On 4/30/07, Normandie Azucena <Normandie.Q.Azucena@...> wrote:
        > hi all!
        >
        > I need to know if a certain buffer is modified. how can I do this?

        if &modified | echo "buffer is modified" | endif

        > also can I disable the prompt that says that buffer or file has changed
        > and gives me an option to load the new file or not? because I want vim
        > to automatically load changed files at certain times(i.e. when I invoke
        > a certain function that automatically change the contents of the files)

        Add exclamation mark to the command

        Yakov
      • Normandie Azucena
        ... From: Yakov Lerner [mailto:iler.ml@gmail.com] Sent: Monday, April 30, 2007 1:53 PM To: Normandie Azucena Cc: vim@vim.org Subject: Re: determining if buffer
        Message 3 of 4 , Apr 30, 2007
        • 0 Attachment
          -----Original Message-----
          From: Yakov Lerner [mailto:iler.ml@...]
          Sent: Monday, April 30, 2007 1:53 PM
          To: Normandie Azucena
          Cc: vim@...
          Subject: Re: determining if buffer is modified.. etc

          On 4/30/07, Normandie Azucena <Normandie.Q.Azucena@...> wrote:
          > hi all!
          >
          > I need to know if a certain buffer is modified. how can I do this?

          if &modified | echo "buffer is modified" | endif

          > also can I disable the prompt that says that buffer or file has
          changed
          > and gives me an option to load the new file or not? because I want vim
          > to automatically load changed files at certain times(i.e. when I
          invoke
          > a certain function that automatically change the contents of the
          files)

          Add exclamation mark to the command

          Yakov

          hi yakov!
          tnx for the info.

          however about my 2nd question, what I wanted to know is this scenario

          I have a file lets say myfile.
          its currently open to a buffer.
          but then I input this file to a perl script then save the results
          what vim will do is prompt me that my file changed and make me choose to
          load it or not (because it is open in a buffer).
          This scenario is what I don't want to happen because obviously it was
          really my intention to change the file in the first place.

          can I disable this prompt somehow?

          tnx!
          normandie
        • Yakov Lerner
          ... Yakov
          Message 4 of 4 , Apr 30, 2007
          • 0 Attachment
            On 4/30/07, Normandie Azucena <Normandie.Q.Azucena@...> wrote:
            > -----Original Message-----
            > From: Yakov Lerner [mailto:iler.ml@...]
            > Sent: Monday, April 30, 2007 1:53 PM
            > To: Normandie Azucena
            > Cc: vim@...
            > Subject: Re: determining if buffer is modified.. etc
            >
            > On 4/30/07, Normandie Azucena <Normandie.Q.Azucena@...> wrote:
            > > hi all!
            > >
            > > I need to know if a certain buffer is modified. how can I do this?
            >
            > if &modified | echo "buffer is modified" | endif
            >
            > > also can I disable the prompt that says that buffer or file has
            > changed
            > > and gives me an option to load the new file or not? because I want vim
            > > to automatically load changed files at certain times(i.e. when I
            > invoke
            > > a certain function that automatically change the contents of the
            > files)
            >
            > Add exclamation mark to the command
            >
            > Yakov
            >
            > hi yakov!
            > tnx for the info.
            >
            > however about my 2nd question, what I wanted to know is this scenario
            >
            > I have a file lets say myfile.
            > its currently open to a buffer.
            > but then I input this file to a perl script then save the results
            > what vim will do is prompt me that my file changed and make me choose to
            > load it or not (because it is open in a buffer).
            > This scenario is what I don't want to happen because obviously it was
            > really my intention to change the file in the first place.
            >
            > can I disable this prompt somehow?

            :set autoread

            Yakov
          Your message has been successfully submitted and would be delivered to recipients shortly.