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

Issue 155 in vim: feature request: Option for keeping cursor position while scrolling by mouse

Expand Messages
  • vim@...
    Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 155 by gade...@gmail.com: feature request: Option for keeping cursor position while
    Message 1 of 2 , Jul 22, 2013
    • 0 Attachment
      Status: New
      Owner: ----
      Labels: Type-Defect Priority-Medium

      New issue 155 by gade...@...: feature request: Option for keeping
      cursor position while scrolling by mouse
      http://code.google.com/p/vim/issues/detail?id=155

      Right now, vim always shows cursor in viewable part of window by changing
      its position as viewport changes, even when user is scrolling by mouse
      wheel. Personally, I hate this. I understand that vim's philosophy is that
      you should never use a mouse, but mouse wheel is perfect for looking around
      document and no keyboard key can replace this functionality properly: users
      use mouse wheel to see what is out of the visible part of screen and no key
      replaces this properly. I don't think anybody use mouse wheel scrolling in
      vim for positioning cursor on exact line as they want as this method is
      highly inaccurate or slow for this - user have to scroll very slow to not
      overscroll desired line - if he does and still want to do this by mouse, he
      will need to scroll back by all of the height of buffer + missed lines
      because cursor stays on position if it does not reach border of viewport.

      Because of this, if user want to go to new position below viewport, he
      instead use mouse scrolling only to position viewport to part of document
      where approximately is located line which user want to edit and then he
      will most probably use mouse click (they are still holding mouse right?) or
      use gg instead (or similar movement commands) as he now see line number.

      I understand that some users maybe prefer it the way it is now - e.g.
      people using relative line numbering thanks to this feature don't have to
      type 1350gg to move to desired line, but instead 15+ as cursor is closer to
      desired line. That's why I'm asking for option for us.

      If this is implemented, people can use mouse wheel in vim not only for
      changing cursor position to new unknown location (outside of view) but they
      can use it too in a way that they can scroll down/up to see what is
      below/above viewport, but when they want to continue in editing line they
      were editing, they just do it and viewport automatically changes to cursor
      position. If user want do this now without this proposed option, he has to
      use mark - and if he is in other mode, he have to exit this mode and then
      enter to this mode again (or use <C-o> in insert mode or key binding,
      doesn't matter still a lot more unergonomic than doing nothing). Because
      jumplist changes as cursor changes its position line by line when scrolling
      out of viewport, it can't be used comfortably either - because user doesn't
      know position of item in jumplist as it changed multiple times since then.

      Also, it wouldn't manipulate with selection if user is in visual mode as it
      is now.

      As another added benefits, scrolling with this options would be faster and
      more neat - without flickering cursor which position constantly changes. It
      would be faster because vim won't have to:
      - calculate new location of cursor (start/end of line, start/end of words
      or similar behaviour which vim has now)
      - move and display cursor to new position
      - change active line background if option cursorline is set
      - highlight current line number
      - expand current visual selection

      --
      You received this message because this project is configured to send all
      issue notifications to this address.
      You may adjust your notification preferences at:
      https://code.google.com/hosting/settings

      --
      --
      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.
    • John Little
      ... This issue is not about the mouse, and if vim s philosophy was that you should never use the mouse, there d be no mouse support! Rather, it s that vim
      Message 2 of 2 , Jul 22, 2013
      • 0 Attachment
        On Tuesday, July 23, 2013 5:49:23 AM UTC+12, v...@... wrote:
        > New issue 155 by gade...@...: feature request: Option for keeping
        > cursor position while scrolling by mouse
        > http://code.google.com/p/vim/issues/detail?id=155
        >
        > Right now, vim always shows cursor in viewable part of window by changing
        > its position as viewport changes, even when user is scrolling by mouse
        > wheel. Personally, I hate this. I understand that vim's philosophy is that
        > you should never use a mouse...

        This issue is not about the mouse, and if vim's philosophy was that you should never use the mouse, there'd be no mouse support! Rather, it's that vim always shows the current cursor position in a window, so if you scroll the window, however, the current cursor position is moved to keep it in the window.

        That's the way vim works presently, and I imagine it would be difficult to add this feature, but IMO it has some merit. There'd have to be a clear specification of what happens if the current position isn't displayed, and a text changing command occurred.

        Vim has many ways to move the cursor, perhaps setting a mark before scrolling would get you back to where you want. I'd expect there's a plugin that meets your need.

        Regards, John

        --
        --
        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.