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

Reading variables of a buffer/window that is not in scope

Expand Messages
  • Brandon Coleman
    I would like to read the contents of variables for buffers that are not in scope. How would I go about doing this? Is there an example of a way to loop
    Message 1 of 3 , Oct 1, 2012
      I would like to read the contents of variables for buffers that are not in scope. How would I go about doing this? Is there an example of a way to loop through all of the buffers? is there a command lookupWinVar(1,testVar)?

      Brandon

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Jürgen Krämer
      Hi, ... I don t know if there is a function which gives you all existing buffers, but you can loop through buffer numbers from 1 to bufnr( $ ) and check if the
      Message 2 of 3 , Oct 2, 2012
        Hi,

        Brandon Coleman wrote:
        > I would like to read the contents of variables for buffers that are
        > not in scope. How would I go about doing this? Is there an example
        > of a way to loop through all of the buffers? is there a command
        > lookupWinVar(1,testVar)?

        I don't know if there is a function which gives you all existing buffers,
        but you can loop through buffer numbers from 1 to bufnr('$') and check if
        the buffer really exists with bufexists().

        Buffer-local variables can be read with getbufvar().

        Regards,
        Jürgen

        --
        Sometimes I think the surest sign that intelligent life exists elsewhere
        in the universe is that none of it has tried to contact us. (Calvin)

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Ben Fritz
        ... The best I know of is tabpagebuflist() ... See also getwinvar(), gettabvar(), gettabwinvar(), and the set function for all of these. -- You received this
        Message 3 of 3 , Oct 2, 2012
          On Tuesday, October 2, 2012 3:34:58 AM UTC-5, Jürgen Krämer wrote:
          >
          > I don't know if there is a function which gives you all existing buffers,
          >

          The best I know of is tabpagebuflist()

          > but you can loop through buffer numbers from 1 to bufnr('$') and check if
          >
          > the buffer really exists with bufexists().
          >
          >
          >
          > Buffer-local variables can be read with getbufvar().
          >
          >

          See also getwinvar(), gettabvar(), gettabwinvar(), and the "set" function for all of these.

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.