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

Local/Global tags variable

Expand Messages
  • Paul Kippes
    I m aware that beginning in vim60w, set tags can be unique for each buffer. But knowing this, I m unsure if the following is suppose to work. I first
    Message 1 of 8 , Mar 1, 2001
    • 0 Attachment
      I'm aware that beginning in vim60w, "set tags" can be unique for
      each buffer. But knowing this, I'm unsure if the following is
      suppose to work. I first noticed the situation starting in
      vim60w.

      ----- My reduced .vimrc file -----
      set nocompatible
      set &tags="/home/pkippes/tags/tags-bw65"
      ----------------------------------

      In vim60w, tagging to a tag within the current file is fine.
      But once I tag outside the current file, my "set tags?" becomes
      "tags=./tags,tags".

      Also, if I start vim with line #2 of the above .vimrc file
      removed and then "set tags=/home/pkippes/tags/tags-bw65" things
      work as before vim60w. (I.e. tagging to outside the current
      file does not modify the tags setting.)

      Is this the new behavior? Also, how does one modify
      local/global settings?

      Thanks


      __________________________________________________
      Do You Yahoo!?
      Get email at your own domain with Yahoo! Mail.
      http://personal.mail.yahoo.com/
    • Douglas L . Potts
      ... I could be wrong, but I thing you want to: set &tags set tags+=/home/pkippes/tags/tags-bw65 You want to make sure that tags are first set to the default
      Message 2 of 8 , Mar 1, 2001
      • 0 Attachment
        Paul Kippes spake saying:
        > I'm aware that beginning in vim60w, "set tags" can be unique for
        > each buffer. But knowing this, I'm unsure if the following is
        > suppose to work. I first noticed the situation starting in
        > vim60w.
        >
        > ----- My reduced .vimrc file -----
        > set nocompatible
        > set &tags="/home/pkippes/tags/tags-bw65"
        > ----------------------------------
        I could be wrong, but I thing you want to:
        set &tags
        set tags+=/home/pkippes/tags/tags-bw65

        You want to make sure that tags are first set to the default setting,
        and then add your tags file location to it. Is this your intent?
        Because your line above, doesn't even work for me. It gives an error:
        Unknown option: &tags=

        Or perhaps you meant let &tags=...
        >
        > In vim60w, tagging to a tag within the current file is fine.
        > But once I tag outside the current file, my "set tags?" becomes
        > "tags=./tags,tags".
        >
        > Also, if I start vim with line #2 of the above .vimrc file
        > removed and then "set tags=/home/pkippes/tags/tags-bw65" things
        > work as before vim60w. (I.e. tagging to outside the current
        > file does not modify the tags setting.)
        >
        > Is this the new behavior? Also, how does one modify
        > local/global settings?
        :h local-options
        :h global-local

        HTH,
        -Doug

        --
        *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
        Douglas L. Potts Spectral Systems, Inc. http://www.bigfoot.com/~pottsdl
        "But you can't expect to wield supreme executive power just 'cause some
        watery tart threw a sword at you!"
        -Dennis, "Monty Python and the Holy Grail"
        *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
      • Paul Kippes
        Correct. It should read let &tags= /home/pkippes/tags/tags-bw65 The question still stands. Does the tags setting now default to a local variable? How
        Message 3 of 8 , Mar 1, 2001
        • 0 Attachment
          Correct. It should read
          let &tags="/home/pkippes/tags/tags-bw65"

          The question still stands. Does the "tags" setting now default
          to a local variable? How would one determine/know this?

          Also, using the corrected .vimrc I gave earlier, I can create a
          new buffer (with :new) and buffers #1 and #2 now have different
          tags settings.


          --- "Douglas L . Potts" <dp@...-sys.com> wrote:
          > Paul Kippes spake saying:
          > > I'm aware that beginning in vim60w, "set tags" can be unique
          > for
          > > each buffer. But knowing this, I'm unsure if the following
          > is
          > > suppose to work. I first noticed the situation starting in
          > > vim60w.
          > >
          > > ----- My reduced .vimrc file -----
          > > set nocompatible
          > > set &tags="/home/pkippes/tags/tags-bw65"
          > > ----------------------------------
          > I could be wrong, but I thing you want to:
          > set &tags
          > set tags+=/home/pkippes/tags/tags-bw65
          >
          > You want to make sure that tags are first set to the default
          > setting,
          > and then add your tags file location to it. Is this your
          > intent?
          > Because your line above, doesn't even work for me. It gives
          > an error:
          > Unknown option: &tags=
          >
          > Or perhaps you meant let &tags=...
          > >
          > > In vim60w, tagging to a tag within the current file is fine.
          >
          > > But once I tag outside the current file, my "set tags?"
          > becomes
          > > "tags=./tags,tags".
          > >
          > > Also, if I start vim with line #2 of the above .vimrc file
          > > removed and then "set tags=/home/pkippes/tags/tags-bw65"
          > things
          > > work as before vim60w. (I.e. tagging to outside the current
          > > file does not modify the tags setting.)
          > >
          > > Is this the new behavior? Also, how does one modify
          > > local/global settings?
          > :h local-options
          > :h global-local
          >
          > HTH,
          > -Doug
          >
          > --
          >
          *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
          > Douglas L. Potts Spectral Systems, Inc.
          > http://www.bigfoot.com/~pottsdl
          > "But you can't expect to wield supreme executive power just
          > 'cause some
          > watery tart threw a sword at you!"
          > -Dennis, "Monty Python and the Holy Grail"
          >
          *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*


          __________________________________________________
          Do You Yahoo!?
          Get email at your own domain with Yahoo! Mail.
          http://personal.mail.yahoo.com/
        • Bram Moolenaar
          ... (that last :set should be a :let) ... Yep. What happened is that the tags option now has a local value. If you use :let &opt = val it will set the
          Message 4 of 8 , Mar 1, 2001
          • 0 Attachment
            Paul Kippes wrote:

            > I'm aware that beginning in vim60w, "set tags" can be unique for
            > each buffer. But knowing this, I'm unsure if the following is
            > suppose to work. I first noticed the situation starting in
            > vim60w.
            >
            > ----- My reduced .vimrc file -----
            > set nocompatible
            > set &tags="/home/pkippes/tags/tags-bw65"
            > ----------------------------------

            (that last :set should be a :let)

            > In vim60w, tagging to a tag within the current file is fine.
            > But once I tag outside the current file, my "set tags?" becomes
            > "tags=./tags,tags".

            Yep. What happened is that the 'tags' option now has a local value. If you
            use ":let &opt = val" it will set the local value, like ":setlocal". Thus the
            global value of 'tags' is unchanged and still used in other files.

            > Also, if I start vim with line #2 of the above .vimrc file
            > removed and then "set tags=/home/pkippes/tags/tags-bw65" things
            > work as before vim60w. (I.e. tagging to outside the current
            > file does not modify the tags setting.)

            The ":set" command sets the global value of 'tags', to be backwards
            compatible.

            Would it be important to make ":set &opt = val" backwards compatible as well?
            I suppose it is.

            > Is this the new behavior? Also, how does one modify
            > local/global settings?

            Then we need new ways to access the local value. And probably also a way to
            set the global value. How about this:

            :let &opt = val like in Vim 5.7
            :let &%opt = val global value?
            :let &.opt = val local value?

            --
            Those who live by the sword get shot by those who don't.

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
            \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
          • Paul Kippes
            ... This looks great. I thought there might have been something missing (from a usability standpoint). Thanks!
            Message 5 of 8 , Mar 1, 2001
            • 0 Attachment
              --- Bram Moolenaar <Bram@...> wrote:
              > Then we need new ways to access the local value. And probably
              > also a way to
              > set the global value. How about this:
              >
              > :let &opt = val like in Vim 5.7
              > :let &%opt = val global value?
              > :let &.opt = val local value?

              This looks great. I thought there might have been something
              "missing" (from a usability standpoint).

              Thanks!


              __________________________________________________
              Do You Yahoo!?
              Get email at your own domain with Yahoo! Mail.
              http://personal.mail.yahoo.com/
            • Benji Fisher
              ... [snip] ... I like the idea, but not the syntax. How about ... for global, buffer, and window options? Also, please clarify what like in Vim 5.7 means.
              Message 6 of 8 , Mar 1, 2001
              • 0 Attachment
                Bram Moolenaar wrote:
                >
                [snip]
                > Then we need new ways to access the local value. And probably also a way to
                > set the global value. How about this:
                >
                > :let &opt = val like in Vim 5.7
                > :let &%opt = val global value?
                > :let &.opt = val local value?

                I like the idea, but not the syntax. How about

                :let &opt = val
                :let &g:opt = val
                :let &b:opt = val
                :let &w:opt = val

                for global, buffer, and window options? Also, please clarify what "like
                in Vim 5.7" means. Does this mean set the local value if it is a local
                option, set the global value if it is a global option (with or without a
                local value)?

                --Benji Fisher
              • Zdenek Sekera
                ... I think Benji s syntax goes very well with the general varable syntax and is much more readable.
                Message 7 of 8 , Mar 1, 2001
                • 0 Attachment
                  Benji Fisher wrote:
                  >
                  > Bram Moolenaar wrote:
                  > >
                  > [snip]
                  > > Then we need new ways to access the local value. And probably also a way to
                  > > set the global value. How about this:
                  > >
                  > > :let &opt = val like in Vim 5.7
                  > > :let &%opt = val global value?
                  > > :let &.opt = val local value?
                  >
                  > I like the idea, but not the syntax. How about
                  >
                  > :let &opt = val
                  > :let &g:opt = val
                  > :let &b:opt = val
                  > :let &w:opt = val

                  I think Benji's syntax goes very well with the general varable
                  syntax and is much more readable.

                  ---Zdenek
                • Bram Moolenaar
                  ... OK. But I prefer to use &l: for :setlocal . Otherwise users may get the idea that they can set a window-local value for a buffer-local option. Also,
                  Message 8 of 8 , Mar 2, 2001
                  • 0 Attachment
                    Benji Fisher wrote:

                    > Bram Moolenaar wrote:
                    > >
                    > [snip]
                    > > Then we need new ways to access the local value. And probably also a way to
                    > > set the global value. How about this:
                    > >
                    > > :let &opt = val like in Vim 5.7
                    > > :let &%opt = val global value?
                    > > :let &.opt = val local value?
                    >
                    > I like the idea, but not the syntax. How about
                    >
                    > :let &opt = val
                    > :let &g:opt = val
                    > :let &b:opt = val
                    > :let &w:opt = val

                    OK. But I prefer to use &l: for ":setlocal". Otherwise users may get the
                    idea that they can set a window-local value for a buffer-local option.
                    Also, you probably have to lookup if an option is window-local or
                    buffer-local.

                    > for global, buffer, and window options? Also, please clarify what "like
                    > in Vim 5.7" means. Does this mean set the local value if it is a local
                    > option, set the global value if it is a global option (with or without a
                    > local value)?

                    I'll have to check what 5.7 did exactly, but I think it's what you describe.
                    At least it should set the global value of global options with a local value.

                    --
                    Latest survey shows that 3 out of 4 people make up 75% of the
                    world's population.

                    /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                    ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                    \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                  Your message has been successfully submitted and would be delivered to recipients shortly.