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

Advice for efficient navigation using the jump list

Expand Messages
  • Marco
    Hi, I like navigating the jump list using ctrl-o and ctrl-i. The problem is that I also prefer to use relativenumber. Both settings, unfortunately, do not
    Message 1 of 4 , Jan 25, 2013
    • 0 Attachment
      Hi,

      I like navigating the jump list using ctrl-o and ctrl-i. The problem
      is that I also prefer to use relativenumber. Both settings,
      unfortunately, do not match very well.

      If I have relativenumber set, I navigate to the visible text parts
      using e.g. 15k or 22j. However, these jumps are not recorded in the
      jump list. This basically means using relativenumber entirely
      invalidates the usefulness of the jump list.

      If I use number instead of relativenumber, navigation by line
      numbers gets really painful. I then navigate using e.g.
      12843gg or 1937gg

      As a consequence I either use the search (/, ?) instead of direct
      jumps or the change list (g;, g,). But I feel that both are sort-of
      unpredictable and not suitable in all cases or even slower compared
      to e.g. 15k.

      Any suggestions about how to improve my workflow or even a solution
      for relativenumber and the jump list to be friends? Maybe there is a
      setting which adds j and k jumps which are preceded by a count to
      the jump list.

      Marco
    • Jeroen Budts
      ... Marco, A few weeks ago I had *exactly* the same feeling. For this reason I wrote the small plugin named jk-jumps , which is available here:
      Message 2 of 4 , Jan 25, 2013
      • 0 Attachment
        On 01/25/2013 09:29 PM, Marco wrote:
        > Hi,
        >
        > I like navigating the jump list using ctrl-o and ctrl-i. The problem
        > is that I also prefer to use relativenumber. Both settings,
        > unfortunately, do not match very well.
        >
        > If I have relativenumber set, I navigate to the visible text parts
        > using e.g. 15k or 22j. However, these jumps are not recorded in the
        > jump list. This basically means using relativenumber entirely
        > invalidates the usefulness of the jump list.
        >
        > If I use number instead of relativenumber, navigation by line
        > numbers gets really painful. I then navigate using e.g.
        > 12843gg or 1937gg
        >
        > As a consequence I either use the search (/, ?) instead of direct
        > jumps or the change list (g;, g,). But I feel that both are sort-of
        > unpredictable and not suitable in all cases or even slower compared
        > to e.g. 15k.
        >
        > Any suggestions about how to improve my workflow or even a solution
        > for relativenumber and the jump list to be friends? Maybe there is a
        > setting which adds j and k jumps which are preceded by a count to
        > the jump list.
        >
        > Marco
        >
        Marco,

        A few weeks ago I had *exactly* the same feeling. For this reason I
        wrote the small plugin named 'jk-jumps', which is available here:
        http://www.vim.org/scripts/script.php?script_id=4395. (it's probably one
        of the smallest plugins available :)).
        It basically changes the j and k keys to act as usual, but make Vim
        recognize those movements as a jump if you jump more than the
        configurable amount of lines. It took me a few releases to get it
        correctly right (regarding folds etc) but with version 0.4 it seems to
        work without any problems now.

        Feel free to comment, suggest features etc on github:
        https://github.com/teranex/jk-jumps.vim.

        I already suspected that I wouldn't be the only one with this idea, so
        this makes me wonder again: wouldn't it be possible/useful to add this
        to Vim itself as an option?

        Jeroen

        --
        website: http://budts.be/ - twitter: @teranex
        ___________________________________
        Registered Linux User #482240 - GetFirefox.com - ubuntu.com



        --
        --
        You received this message from the "vim_use" 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
      • Chris Schneider
        Cool plugin, thanks for sharing. ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
        Message 3 of 4 , Jan 25, 2013
        • 0 Attachment
          Cool plugin, thanks for sharing.


          On Fri, Jan 25, 2013 at 1:43 PM, Jeroen Budts <jeroen@...> wrote:
          On 01/25/2013 09:29 PM, Marco wrote:
          > Hi,
          >
          > I like navigating the jump list using ctrl-o and ctrl-i. The problem
          > is that I also prefer to use relativenumber. Both settings,
          > unfortunately, do not match very well.
          >
          > If I have relativenumber set, I navigate to the visible text parts
          > using e.g. 15k or 22j. However, these jumps are not recorded in the
          > jump list. This basically means using relativenumber entirely
          > invalidates the usefulness of the jump list.
          >
          > If I use number instead of relativenumber, navigation by line
          > numbers gets really painful. I then navigate using e.g.
          > 12843gg or 1937gg
          >
          > As a consequence I either use the search (/, ?) instead of direct
          > jumps or the change list (g;, g,). But I feel that both are sort-of
          > unpredictable and not suitable in all cases or even slower compared
          > to e.g. 15k.
          >
          > Any suggestions about how to improve my workflow or even a solution
          > for relativenumber and the jump list to be friends? Maybe there is a
          > setting which adds j and k jumps which are preceded by a count to
          > the jump list.
          >
          > Marco
          >
          Marco,

          A few weeks ago I had *exactly* the same feeling. For this reason I
          wrote the small plugin named 'jk-jumps', which is available here:
          http://www.vim.org/scripts/script.php?script_id=4395. (it's probably one
          of the smallest plugins available :)).
          It basically changes the j and k keys to act as usual, but make Vim
          recognize those movements as a jump if you jump more than the
          configurable amount of lines. It took me a few releases to get it
          correctly right (regarding folds etc) but with version 0.4 it seems to
          work without any problems now.

          Feel free to comment, suggest features etc on github:
          https://github.com/teranex/jk-jumps.vim.

          I already suspected that I wouldn't be the only one with this idea, so
          this makes me wonder again: wouldn't it be possible/useful to add this
          to Vim itself as an option?

          Jeroen

          --
          website: http://budts.be/ - twitter: @teranex
          ___________________________________
          Registered Linux User #482240 - GetFirefox.com - ubuntu.com



          --
          --
          You received this message from the "vim_use" 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 from the "vim_use" 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
           
           
           
        • Marco
          ... Thanks a million, exactly what I m looking for. ... Brilliant. ... +1 Marco
          Message 4 of 4 , Jan 25, 2013
          • 0 Attachment
            On 2013–01–25 Jeroen Budts wrote:

            > > Maybe there is a setting which adds j and k jumps which are
            > > preceded by a count to the jump list.
            > >
            > > Marco
            > >
            > Marco,
            >
            > A few weeks ago I had *exactly* the same feeling. For this reason
            > I wrote the small plugin named 'jk-jumps'

            Thanks a million, exactly what I'm looking for.

            > Feel free to comment, suggest features etc on github:
            > https://github.com/teranex/jk-jumps.vim.

            Brilliant.

            > so this makes me wonder again: wouldn't it be
            > possible/useful to add this to Vim itself as an option?

            +1

            Marco
          Your message has been successfully submitted and would be delivered to recipients shortly.