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

RE: More about 7.0g

Expand Messages
  • Robert Webb
    ... Hmm, good idea. So maybe it is possible, but still not exactly user-friendly or easy. A per-tab setting similar to guitablabel would make things much
    Message 1 of 12 , May 1 11:30 PM
    • 0 Attachment
      > > - I'd like to be able to put whatever name I want on the tabs.
      > > There doesn't seem to be a way to do this. 'guitablabel' is an
      > > option *shared* by all tabs, so I can't set one tab to "Work" and
      > > another to "Play" for example, and can only set them to different
      > > names if the names are based on their files etc. All I want to do
      > > is set the name of each tab to a fixed string.
      >
      > You can set 'guitablabel' to a function, as shown in the example
      > under ":help setting-guitablabel". Then you can define a function
      > to do something as a function of the tab number returned by
      > tabpagenr(), such as returning the name of the tab stored in a list
      > indexed by tab number.

      Hmm, good idea. So maybe it is possible, but still not exactly
      user-friendly or easy. A per-tab setting similar to 'guitablabel'
      would make things much easier.

      I would probably also only want to set a specific name for some of the
      tabs, leaving the others with the default behaviour. That would
      require my function to reproduce all the cleverness of the built-in
      behaviour. Or can I just return an empty string from the function to
      make that happen for selected tabs?

      Also, depending on the tab number means I can't rearrange the tabs
      without breaking the function. Whereas I presume per-tab options move
      when their tabs are moved.

      Rob.

      --

      Robert Webb <RobertW@...>,
      Want to make polyhedra?
      http://www.software3d.com/Stella.html
    • Doug Kearns
      On Tue, May 02, 2006 at 03:36:02PM +1000, Robert Webb wrote: ... It s best to use += when setting options like this. Regards, Doug
      Message 2 of 12 , May 1 11:34 PM
      • 0 Attachment
        On Tue, May 02, 2006 at 03:36:02PM +1000, Robert Webb wrote:

        <snip>

        > - I previously said that I was disappointed to see that under
        > Windows2000 the tab-line was text rather than GUI. I have since
        > discovered the "e" fplag for 'guioptions'. Since I set 'guioptions'
        > in my _vimrc, and there was no "e" flag before, I didn't get the GUI
        > tab line by default. Wouldn't it make more sense to have a special
        > flag that indicates to NOT use the GUI-version of the tab line?
        > That is by far the less common setting, and would give users new to
        > version 7 the behaviour they would expect, ie use the GUI where
        > possible.

        It's best to use += when setting options like this.

        <snip>

        Regards,
        Doug
      • Robert Webb
        ... Yes, I realise that s the recommendation, but my _vimrc is over 2000 lines and a lot of it old, from before += was added. Many users may still set it the
        Message 3 of 12 , May 1 11:38 PM
        • 0 Attachment
          > > - I previously said that I was disappointed to see that under
          > > Windows2000 the tab-line was text rather than GUI. I have since
          > > discovered the "e" fplag for 'guioptions'. Since I set
          > > 'guioptions' in my _vimrc, and there was no "e" flag before, I
          > > didn't get the GUI tab line by default. Wouldn't it make more
          > > sense to have a special flag that indicates to NOT use the
          > > GUI-version of the tab line? That is by far the less common
          > > setting, and would give users new to version 7 the behaviour they
          > > would expect, ie use the GUI where possible.
          >
          >
          > That's why you should follow the help text from the *guioptions*
          > help:
          >
          > > To avoid problems with flags that are added in the future, use
          > > the "+=" and "-=" feature of ":set" |add-option-flags|.

          Yes, I realise that's the recommendation, but my _vimrc is over 2000
          lines and a lot of it old, from before += was added. Many users may
          still set it the old way and miss out on new stuff by default. Would
          make more sense if any new options changed the default behaviour when
          present, rather than simply specifying default behaviour unless
          absent.

          Thanks,
          Rob.

          --

          Robert Webb <RobertW@...>,
          MineSweeper3D - Take Minesweeper to a whole new dimension!
          http://www.software3d.com/Mines3D
        • Gary Johnson
          ... Agreed. ... I don t think so. ... All good points. Gary -- Gary Johnson | Agilent Technologies garyjohn@spk.agilent.com | Wireless
          Message 4 of 12 , May 1 11:48 PM
          • 0 Attachment
            On 2006-05-02, Robert Webb <RobertW@...> wrote:
            > > > - I'd like to be able to put whatever name I want on the tabs.
            > > > There doesn't seem to be a way to do this. 'guitablabel' is an
            > > > option *shared* by all tabs, so I can't set one tab to "Work" and
            > > > another to "Play" for example, and can only set them to different
            > > > names if the names are based on their files etc. All I want to do
            > > > is set the name of each tab to a fixed string.
            > >
            > > You can set 'guitablabel' to a function, as shown in the example
            > > under ":help setting-guitablabel". Then you can define a function
            > > to do something as a function of the tab number returned by
            > > tabpagenr(), such as returning the name of the tab stored in a list
            > > indexed by tab number.
            >
            > Hmm, good idea. So maybe it is possible, but still not exactly
            > user-friendly or easy. A per-tab setting similar to 'guitablabel'
            > would make things much easier.

            Agreed.

            > I would probably also only want to set a specific name for some of the
            > tabs, leaving the others with the default behaviour. That would
            > require my function to reproduce all the cleverness of the built-in
            > behaviour. Or can I just return an empty string from the function to
            > make that happen for selected tabs?

            I don't think so.

            > Also, depending on the tab number means I can't rearrange the tabs
            > without breaking the function. Whereas I presume per-tab options move
            > when their tabs are moved.

            All good points.

            Gary

            --
            Gary Johnson | Agilent Technologies
            garyjohn@... | Wireless Division
            | Spokane, Washington, USA
          • Bram Moolenaar
            ... Yes, just a few days before a release I hestitate to make changes. It s very easy to have a last minute change cause troubles. ... Perhaps you are using
            Message 5 of 12 , May 2 5:17 AM
            • 0 Attachment
              Robert Webb wrote:

              > Some more suggestions that are probably too late for this release:

              Yes, just a few days before a release I hestitate to make changes. It's
              very easy to have a last minute change cause troubles.

              > - From the help: "The 'omnifunc' option is set by filetype plugins"
              > Why is 'omnifunc' always empty for me? I've tried this with .h,
              > .cpp, and .html files.

              Perhaps you are using older runtime files? It works fine for me.

              > - Can omni-completion also be used when jumping to tags? Eg if I put
              > my cursor on the "G" in "p->GetIndex()" there may be lots of
              > "GetIndex" tags to choose from. Couldn't the omni completion stuff
              > be used to recognise the type of "p" and go to the most appropriate
              > tag?

              Nice idea. The completion mechanism for C uses tags, but for Python,
              for example, it's totally different. Thus this would be a completely
              separate thing. Perhaps some functions (for figuring out the type)
              could be shared. Since this is all in Vim script it can be done with a
              mapping, I don't see a reason to implement it inside Vim.

              > - I'd like to be able to put whatever name I want on the tabs. There
              > doesn't seem to be a way to do this. 'guitablabel' is an option
              > *shared* by all tabs, so I can't set one tab to "Work" and another to
              > "Play" for example, and can only set them to different names if the
              > names are based on their files etc. All I want to do is set the
              > name of each tab to a fixed string.

              Set a tab page local variable and use that in 'guitablabel'.

              > - Why have both 'tabline' and 'guitablabel'? At least 'guitablabel'
              > should work in the text-version too when 'tabline' is not set.

              'tabline' is for the text form, 'guitablabel' is for GUI tabs. I don't
              see how it could work differently without causing a great mess when
              switching from console to GUI with a ":gui" command. You would get
              console highlight stuff in your GUI labels.

              > - When I heard vim now had tabs, the first thing I tried was ":tab".
              > It was the obvious first guess at creating a new tab without looking
              > up the help. Now I know looking in the help doesn't take so long,
              > but the less you have to do it and the more obvious the commands the
              > better. How about when :tab has no arguments after it, it opens a
              > new tab, rather than just doing nothing? It also provides a
              > slightly shorter and easier to remember way to create a new tab.

              You need to read at least a bit of the documentation to use Vim
              features. I think it's good that ":tab" by itself does nothing instead
              of something you didn't expect or even irreversabel.

              > - I previously said that I was disappointed to see that under
              > Windows2000 the tab-line was text rather than GUI. I have since
              > discovered the "e" fplag for 'guioptions'. Since I set 'guioptions'
              > in my _vimrc, and there was no "e" flag before, I didn't get the GUI
              > tab line by default. Wouldn't it make more sense to have a special
              > flag that indicates to NOT use the GUI-version of the tab line?
              > That is by far the less common setting, and would give users new to
              > version 7 the behaviour they would expect, ie use the GUI where
              > possible.

              I don't like a mix of positive and negative flags. It's so much simpler
              to say that something is enabled when the flag is there.

              > - In options.txt it says:
              > "The GUI tabs are only supported on some systens, currently only for
              > GTK."
              > But clearly this is working on Windows too.

              I just updated that text yesterday. This was all added quite late.

              > - The :sort command is great. Would be good to have an "s" option to
              > ignore white space.

              Ignore it in what way? If you want to ignore leading white space you
              can use:

              :sort /\s*/

              --
              BLACK KNIGHT: The Black Knight always triumphs. Have at you!
              ARTHUR takes his last leg off. The BLACK KNIGHT's body lands upright.
              BLACK KNIGHT: All right, we'll call it a draw.
              "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ download, build and distribute -- http://www.A-A-P.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
            • Robert Webb
              ... OK, have done. I know I reported this years ago, several times I think, to the maintainer at the time, but I can t remember who that was, so I ll try
              Message 6 of 12 , May 2 8:29 AM
              • 0 Attachment
                > Please report issues with runtime files to their respective
                > maintainers.

                OK, have done. I know I reported this years ago, several times I
                think, to the maintainer at the time, but I can't remember who that
                was, so I'll try again as it may have changed. If they are not
                responsive though, there needs to be some way to get changes through.

                > Setting 'foldmethod' should be done in the ftplugin, not in the
                > syntax file. But then only if one can expect that most people want
                > folding.

                There is no ftplugin file for VRML files (*.wrl). The folding is
                currently set in the syntax highlighting file.

                > Truncating can be done in hundreds of ways.

                You're right, just wondering what the logic is behind truncating from
                the start rather than the end. I'd understand if it was to get rid of
                the leading path first, but that is already handled specifically by
                some clever code, so it only seems to be the tail that we're talking
                about.

                > > - Dragging tabs to rearrange their order would be nice.
                >
                > I don't think GUI implementations support this. In the console it
                > would be extremely difficult to make it look good.

                I don't think there'd have to be any visual cue at all until you
                release the mouse button and the change is made.

                > > Some more suggestions that are probably too late for this release:
                >
                > Yes, just a few days before a release I hestitate to make changes.
                > It's very easy to have a last minute change cause troubles.

                Yep, understood. If anything's worthwhile and not just a bug-fix,
                just stick it on the todo list for later :-)

                > > - From the help: "The 'omnifunc' option is set by filetype
                > > plugins" Why is 'omnifunc' always empty for me? I've tried this
                > > with .h, .cpp, and .html files.
                >
                > Perhaps you are using older runtime files? It works fine for me.

                When I do :help I get the new help files. Are they found a different
                way from the other runtime files? I used the gvim installation
                program for Windows.

                So I should be seeing 'omnifunc' automatically set to something in a
                *.cpp file, is that right?

                > > - Can omni-completion also be used when jumping to tags? Eg if I
                > > put my cursor on the "G" in "p->GetIndex()" there may be lots of
                > > "GetIndex" tags to choose from. Couldn't the omni completion
                > > stuff be used to recognise the type of "p" and go to the most
                > > appropriate tag?
                >
                > Nice idea. The completion mechanism for C uses tags, but for
                > Python, for example, it's totally different. Thus this would be a
                > completely separate thing. Perhaps some functions (for figuring out
                > the type) could be shared. Since this is all in Vim script it can
                > be done with a mapping, I don't see a reason to implement it inside
                > Vim.

                As long as there's a user-friendly way to do it :-)

                > > - The :sort command is great. Would be good to have an "s" option
                > > to ignore white space.
                >
                > Ignore it in what way?

                So that all strings of space equate to the same thing,
                eg "Hi there" == " Hi there".

                On second thoughts, maybe not all that important.
                It's a common option for diff programs, but probably
                not so relevant for sorting.

                > > > Will inserting "redraw" command before echo help ? Like this:
                > > >
                > > > func! SaveSession()
                > > > mksession! aaaSession.vse
                > > > redraw
                > > > echo "Session saved"
                > > > endfunction
                > >
                > > You're right, this fixes it. Thanks.
                > > But is it a bug still that the echo message is lost due
                > > to a redraw caused by an earlier command? Maybe when echo
                > > goes to the screen, any pending redraw should be carried
                > > out first?
                >
                > ...It's better to leave it as it is, otherwise the scripts that were
                > carefully tuned with how it currently works will break.

                You mean like mine did? :-)

                Thanks,
                Rob.

                --

                Robert Webb <RobertW@...>,
                Want to make polyhedra?
                http://www.software3d.com/Stella.html
              • Bram Moolenaar
                ... Works fine for me. Perhaps you didn t enable filetype plugins? That s where the option is set. -- Sometimes you can protect millions of dollars in your
                Message 7 of 12 , May 2 12:04 PM
                • 0 Attachment
                  Robert Webb wrote:

                  > > > - From the help: "The 'omnifunc' option is set by filetype
                  > > > plugins" Why is 'omnifunc' always empty for me? I've tried this
                  > > > with .h, .cpp, and .html files.
                  > >
                  > > Perhaps you are using older runtime files? It works fine for me.
                  >
                  > When I do :help I get the new help files. Are they found a different
                  > way from the other runtime files? I used the gvim installation
                  > program for Windows.
                  >
                  > So I should be seeing 'omnifunc' automatically set to something in a
                  > *.cpp file, is that right?

                  Works fine for me. Perhaps you didn't enable filetype plugins? That's
                  where the option is set.

                  --
                  Sometimes you can protect millions of dollars in your budget simply by buying
                  a bag of cookies, dropping it on the budget anylyst's desk, and saying
                  something deeply personal such as "How was your weekend, big guy?"
                  (Scott Adams - The Dilbert principle)

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ download, build and distribute -- http://www.A-A-P.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
                • Robert Webb
                  ... Now t:tabName has to be defined in all tabs. I set it to in the other tabs, but then I just get a blank tab name. Would be nice to be able to set the
                  Message 8 of 12 , May 3 8:39 PM
                  • 0 Attachment
                    > > - I'd like to be able to put whatever name I want on the tabs.
                    > > There doesn't seem to be a way to do this. 'guitablabel' is an
                    > > option *shared* by all tabs, so I can't set one tab to "Work" and
                    > > another to "Play" for example, and can only set them to different
                    > > names if the names are based on their files etc. All I want to do
                    > > is set the name of each tab to a fixed string.
                    >
                    > Set a tab page local variable and use that in 'guitablabel'.

                    I tried this:

                    :let t:tabName = "Blah"
                    :set guitablabel=%{t:tabName}

                    Now t:tabName has to be defined in all tabs. I set it to "" in the
                    other tabs, but then I just get a blank tab name. Would be nice to be
                    able to set the name for some tabs, but leave others as default.
                    Ideally, if the expression for 'guitablabel' can't be evaluated for
                    one tab, or if it comes out as an empty string, then that tab should
                    use the default name.

                    Rob.

                    --

                    Robert Webb <RobertW@...>,
                    MineSweeper3D - Take Minesweeper to a whole new dimension!
                    http://www.software3d.com/Mines3D
                  • Bram Moolenaar
                    ... You wouldn t type these things, they would be in a script. There it s not difficult to check for the existence of t:tabName. ... func MyTabName() if
                    Message 9 of 12 , May 4 1:46 AM
                    • 0 Attachment
                      Robert Webb wrote:

                      > > > - I'd like to be able to put whatever name I want on the tabs.
                      > > > There doesn't seem to be a way to do this. 'guitablabel' is an
                      > > > option *shared* by all tabs, so I can't set one tab to "Work" and
                      > > > another to "Play" for example, and can only set them to different
                      > > > names if the names are based on their files etc. All I want to do
                      > > > is set the name of each tab to a fixed string.
                      > >
                      > > Set a tab page local variable and use that in 'guitablabel'.
                      >
                      > I tried this:
                      >
                      > :let t:tabName = "Blah"
                      > :set guitablabel=%{t:tabName}
                      >
                      > Now t:tabName has to be defined in all tabs. I set it to "" in the
                      > other tabs, but then I just get a blank tab name. Would be nice to be
                      > able to set the name for some tabs, but leave others as default.
                      > Ideally, if the expression for 'guitablabel' can't be evaluated for
                      > one tab, or if it comes out as an empty string, then that tab should
                      > use the default name.

                      You wouldn't type these things, they would be in a script. There it's
                      not difficult to check for the existence of t:tabName.

                      :set guitablabel=%{MyTabName()}
                      func MyTabName()
                      if exists('t:tabName')
                      return t:tabName
                      endif
                      return ''
                      endfunc

                      --
                      hundred-and-one symptoms of being an internet addict:
                      14. You start introducing yourself as "Jim at I-I-Net dot net dot au"

                      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                      \\\ download, build and distribute -- http://www.A-A-P.org ///
                      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
                    Your message has been successfully submitted and would be delivered to recipients shortly.