Results 1 to 6 of 6

Thread: gVim and ":set relativenumber"

  1. #1

    Default gVim and ":set relativenumber"

    Hello everyone! I am a new user to openSUSE. Recently, I have encountered a problem that in Windows and openSUSE, gVim behaves differently. I have used the same settings in both systems (Windows 7 and openSUSE 12.3), :set relativenumber :set cursorline but the cursorline number is shown in two ways: ========== Windows 7 Linenumber Content 2 Using gVim in 1 Windows 7 0 with following settings

  2. #2

    Default Re: gVim and ":set relativenumber"

    It seems there is something wrong with my first post. Sorry about that. Please just ignore it.

    Hello everyone! I am a new user to openSUSE. Recently, I have encountered a problem that in Windows and openSUSE, gVim behaves differently.

    I have used the same settings in both systems (Windows 7 and openSUSE 12.3),

    :set relativenumber
    :set cursorline

    but the cursorline number is shown in two ways:

    Windows 7

    Linenumber Content
    2 Using gVim in
    1 Windows 7
    0 with following settings <--cursorline, linenumber "0" is not highlighted
    1 :set relativenumber
    2 :set cursorline

    openSUSE 12.3

    Linenumber Content
    2 Using gVim in
    1 openSUSE 12.3
    *3* with following settings <--cursorline, linenumber "3" is highlighted
    1 :set relativenumber
    2 :set cursorline


    I would prefer that the cursorline number is not highlighted and is marked as "0" (not the real linenumber), just as in Windows 7.

    I am using openSUSE 12.3 (as mentioned above), and have installed gVim by YAST. I have tried to use Vim in terminal and have created a new account to load the default .vimrc file, but it remains the same. I have not compiled from gVim source file yet, because I did not do this before, and I am afraid it may make things worse.

    I have searched the forum and googled, but I failed to find some relative results.

    So does anyone know what might cause the linenumber to behave like that and can it be changed? Thank you all guys!

  3. #3

    Default Re: gVim and ":set relativenumber"

    On 2013-09-17, Bozar <Bozar@no-mx.forums.opensuse.org> wrote:
    > Hello everyone! I am a new user to openSUSE. Recently, I have
    > encountered a problem that in Windows and openSUSE, gVim behaves
    > differently. I have used the same settings in both systems (Windows 7
    > and openSUSE 12.3), :set relativenumber :set cursorline but the
    > cursorline number is shown in two ways: ========== Windows 7
    > Linenumber Content 2 Using gVim in 1 Windows 7 0 with following settings


    I don't understand and use Vim everyday. In Linux, :set relativenumber and :set cursorline do the following:

    :set relativenumber - puts relative numbers (except for the current line) on the left.
    :set cursorline - underlines (or highlights in GVim) the current line.

    Is your problem in Windows or openSUSE? If it's in Windows, then I suspect no-one on this forum can help you. If it's in
    openSUSE, please clarify how your commands are not behaving as expected.



  4. #4

    Default Re: gVim and ":set relativenumber"

    On 2013-09-17, Bozar <Bozar@no-mx.forums.opensuse.org> wrote:
    > It seems there is something wrong with my first post. Sorry about that.
    > Please just ignore it.


    Okay.

    > Hello everyone! I am a new user to openSUSE. Recently, I have
    > encountered a problem that in Windows and openSUSE, gVim behaves
    > differently.
    >
    > I have used the same settings in both systems (Windows 7 and openSUSE
    > 12.3),
    >
    >:set relativenumber
    >:set cursorline
    >
    > but the cursorline number is shown in two ways:
    > <SNIP>
    > I would prefer that the cursorline number is not highlighted and is


    Do you mean that the number is itself highlighted in GVim? I certainly don't see this being the case. Please output the
    result of...

    Code:
    sh-4.2$ sudo zypper info gvim
    .... inside code tags iconified as an octothorpe (#) in the forum toolbar.

    > marked as "0" (not the real linenumber), just as in Windows 7.


    I believe this was a Vim patch effect (somewhere during version 7.3.x). The matter is discussed with Bram (the author)
    at http://groups.google.com/forum/#!top...ev/tOmXNHXsAKE . The logic was that having `0' is always less informative
    than having the absolute line number, and it is distinguishable from its neighbours by being left-flushed rather than
    right-flushed. If you dislike this behaviour, then you need so seek a pre-patched version of Vim. There may be a
    workaround but I wouldn't know them because intensely dislike :set cursorline and :set relativenumber in my ~/.vimrc.


  5. #5

    Default Re: gVim and ":set relativenumber"

    Thank you flymail!

    > Please output the
    > result of...
    >
    Code:
    sh-4.2$ sudo zypper info gvim
    > .... inside code tags iconified as an octothorpe (#) in the forum toolbar.


    Code:
    Information for package gvim:
    -----------------------------
    Repository: Main Repository (OSS)
    Name: gvim
    Version: 7.3.831-1.1.1
    Arch: x86_64
    Vendor: openSUSE
    Installed: Yes
    Status: up-to-date
    Installed Size: 2.3 MiB
    Summary: A GUI for Vi
    > Do you mean that the number is itself highlighted in GVim?

    Yes, exactly. It seems that my gVim in Windows is an older version in which ": set relativenumber" remains unpatched. I don't like the changes about this setting, but it is OK with me to work with no linenumber at all. Anyway, it feels good to figure out the reason.

  6. #6

    Default Re: gVim and ":set relativenumber"

    On 2013-09-19, Bozar <Bozar@no-mx.forums.opensuse.org> wrote:
    > Thank you flymail!


    Pleasure.

    On 2013-09-19, Bozar <Bozar@no-mx.forums.opensuse.org> wrote:
    > Code:
    > --------------------
    > Information for package gvim:
    > -----------------------------
    > Repository: Main Repository (OSS)
    > Name: gvim
    > Version: 7.3.831-1.1.1
    > Arch: x86_64
    > Vendor: openSUSE
    > Installed: Yes
    > Status: up-to-date
    > Installed Size: 2.3 MiB
    > Summary: A GUI for Vi
    > --------------------



    Okay, so you're GVim is up to date.

    On 2013-09-19, Bozar <Bozar@no-mx.forums.opensuse.org> wrote:
    > Yes, exactly. It seems that my gVim in Windows is an older version in
    > which ": set relativenumber" remains unpatched. I don't like the changes
    > about this setting, but it is OK with me to work with no linenumber at
    > all. Anyway, it feels good to figure out the reason.


    Hmmm. In which case I can only think of three workarounds for you:

    1. Use Vim rather than GVim. It has much more sober highlighting than GVim and works very nicely inside Konsole.
    2. Uninstall Vim/GVim and install a retro-patched version perhaps corresponding to the one you use in Windows.
    3. Contact Bram through Google+ listing your feature requests. He's more likely to implement them if you vimscript them.

    Personally I think :set number is much more code-friendly than :set relativenumber. But I guess it depends on what you
    use Vim for.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •