Skip to content

line number and jumping to context line #69

Closed

Description

@maxigit

It would be nice to be able to jump to a line you can see the context window (like when you press H).
I personnaly will be happy for it to be mapped to <count>H but any mapping will do.
Alternatively, displaying the line number in the context window (in accordance with set number and set relativenumber would help.

Activity

  1. wellle commented on May 1, 2020

    @wellle
    Owner

    Interesting idea!

    FWIW what I'm currently using for this: With https://github.com/jeetsukumaran/vim-indentwise you can type [- to jump through the context lines by decreasing indentation.

    As for showing line numbers we have #40.

  2. maxigit commented on May 5, 2020

    @maxigit
    ContributorAuthor

    I didn't know about vim-indentwise which seems quite cool indeed.
    To get why I want I'll need 0[_ instead of [- but that's a details.
    However, an alternative to this (and displaying line number) would be to set number in the context window (which I understand will display 1, 2, 3 etc which can then be used in combination with H so that 1H goes to the first context, line, 2H the second etc ...
    To do so, It seems that you only need to store the line number as well as the line in w:context and use it.

  3. wellle commented on Aug 24, 2020

    @wellle
    Owner

    @maxigit: I just added support for line numbers in #81. So if you :set relativenumber you can use the displayed relative line numbers to jump to the context lines. Would you say that's enough to close this issue? Thank you!

  4. wellle commented on Aug 24, 2020

    @wellle
    Owner

    context-example

    For example in this screenshot if you want to jump to the VAR_FUNC line (third context line) you could type 52k.

  5. maxigit commented on Aug 25, 2020

    @maxigit
    ContributorAuthor
  6. wellle commented on Aug 25, 2020

    @wellle
    Owner

    @maxigit: Thanks for reporting, this has been fixed in #82. Please try again 🙏

  7. maxigit commented on Aug 26, 2020

    @maxigit
    ContributorAuthor
  8. wellle commented on Aug 26, 2020

    @wellle
    Owner

    Cool, I'll close this issue then. Thanks again!

  9. maxigit commented on Aug 27, 2020

    @maxigit
    ContributorAuthor
  10. wellle commented on Aug 27, 2020

    @wellle
    Owner

    Thank you for reporting this.

    To be fully honest I am aware of this and had already started working on fixing it, but then wondered if people are actually using custom indent functions. So I decided to just release #81 and see if someone complains about it. So I have taken notice and will fix this 👍

  11. reopened this on Aug 27, 2020
  12. wellle commented on Aug 27, 2020

    @wellle
    Owner

    @maxigit: I fixed it in #85. Please have a look at the PR description as this changes the return value of the custom indent functions. Please let me know if anything is unclear or still not working as expected. Thanks again!

  13. maxigit commented on Aug 28, 2020

    @maxigit
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions