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

difference between number and relativenumber

Expand Messages
  • tooth pik
    I have a script that formats a window I create with gvim (big, 7.3.875) The script, among other things, turns number off -- this works as long as my .vimrc
    Message 1 of 3 , Mar 30 8:16 AM
    • 0 Attachment
      I have a script that formats a window I create with gvim (big, 7.3.875)

      The script, among other things, turns number off -- this works as long
      as my .vimrc only sets number. If my vimrc sets relativenumber the
      scripted nonumber has no effect, and the window opens with
      relativenumbers -- even more perplexing, verbose set number? reports
      nonumber, and that it was set via the tinyscript.vim, but the window
      has relative numbers bigger'n doggy doo.

      steps to reproduce:

      - make a directory so you can whack it all easily when you're done
      - cd to that new directory
      - create tinyscript.vim containing only
      set nonumber
      - create tinyvimrc containing only
      set nocompatible
      set number
      - create tinyvimrc2 containing only
      set nocompatible
      set relativenumber

      to see gvim start as it's supposed to, run

      gvim --noplugin -u tinyvimrc -c 'source tinyscript.vim'

      the window will open with number off

      however, if you start gvim with

      gvim --noplugin -u tinyvimrc2 -c 'source tinyscript.vim'

      the window will open with relative numbers showing, but mis-reported
      by :verbose set number?

      maybe this was introduced when we changed from showing a zero for
      current line to showing the current line number in relativenumber (a
      wild guess) -- I was starting to get used to that when this weirdness
      showed up so I had to change my vimrc back to 'number'

      tia,
      tp

      --
      --
      You received this message from the "vim_dev" 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

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • glts
      ... I don t know but I d say this is as it should be. Number and relativenumber are related but separate. So if your vimrc sets number then you have to
      Message 2 of 3 , Mar 30 8:53 AM
      • 0 Attachment
        On Sat, Mar 30, 2013 at 4:16 PM, tooth pik <toothpik6@...> wrote:
        > The script, among other things, turns number off -- this works as long
        > as my .vimrc only sets number. If my vimrc sets relativenumber the
        > scripted nonumber has no effect, and the window opens with
        > relativenumbers -- even more perplexing, verbose set number? reports
        > nonumber, and that it was set via the tinyscript.vim, but the window
        > has relative numbers bigger'n doggy doo.

        I don't know but I'd say this is as it should be.

        'Number' and 'relativenumber' are related but separate. So if your vimrc
        sets 'number' then you have to turn it off with ":set nonumber". If your
        vimrc sets 'relativenumber' you have to turn it off with ":set
        norelativenumber".

        And :verbose reports correctly, too: The last time the 'number' option
        was set was indeed by "set nonumber" in tinyscript.vim. But this is
        masked by 'relativenumber' which is still on.

        --
        --
        You received this message from the "vim_dev" 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

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • tooth pik
        ... sorry -- I assumed nonumber would turn either of them off -- silly me -- I guess I need to test what s on so I can get specific about what I turn off --
        Message 3 of 3 , Mar 30 10:10 AM
        • 0 Attachment
          On Sat, Mar 30, 2013 at 04:53:56PM +0100, glts wrote:
          > On Sat, Mar 30, 2013 at 4:16 PM, tooth pik <toothpik6@...> wrote:
          > > The script, among other things, turns number off -- this works as long
          > > as my .vimrc only sets number. If my vimrc sets relativenumber the
          > > scripted nonumber has no effect, and the window opens with
          > > relativenumbers -- even more perplexing, verbose set number? reports
          > > nonumber, and that it was set via the tinyscript.vim, but the window
          > > has relative numbers bigger'n doggy doo.

          > I don't know but I'd say this is as it should be.

          > 'Number' and 'relativenumber' are related but separate. So if your vimrc
          > sets 'number' then you have to turn it off with ":set nonumber". If your
          > vimrc sets 'relativenumber' you have to turn it off with ":set
          > norelativenumber".

          sorry -- I assumed 'nonumber' would turn either of them off -- silly
          me -- I guess I need to test what's on so I can get specific about
          what I turn off -- or simpler would be to just turn off both...

          thx glts

          --
          --
          You received this message from the "vim_dev" 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

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.