zed icon indicating copy to clipboard operation
zed copied to clipboard

vim-mode: support count and scrolloff with H/M/L

Open noritada opened this issue 2 years ago • 3 comments

Check for existing issues

  • [X] Completed

Describe the feature

In Vim, users can move to the first/middle/last lines in the visible area with H (home), M (middle), and L (last) keys (capital letters of them mean typing while holding down Shift). Although it is used less frequently than paragraph-by-paragraph jumps as requested in zed-industries/zed#5693 , sometimes it is useful.

See :help H in Vim:

H                       To line [count] from top (Home) of window (default:
                        first line on the window) on the first non-blank
                        character linewise.  See also 'startofline' option.
                        Cursor is adjusted for 'scrolloff' option, unless an
                        operator is pending, in which case the text may
                        scroll.  E.g. "yH" yanks from the first visible line
                        until the cursor line (inclusive).

                                                M
M                       To Middle line of window, on the first non-blank
                        character linewise.  See also 'startofline' option.

                                                L
L                       To line [count] from bottom of window (default: Last
                        line on the window) on the first non-blank character
                        linewise.  See also 'startofline' option.
                        Cursor is adjusted for 'scrolloff' option, unless an
                        operator is pending, in which case the text may
                        scroll.  E.g. "yL" yanks from the cursor to the last
                        visible line.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

noritada avatar Mar 15 '23 10:03 noritada

We now have basic support thanks to @vbhavsar , this issue tracks adding count support and scrolloff support to these actions.

ConradIrwin avatar Jan 30 '24 04:01 ConradIrwin

Counts for H and L motions are available in Zed v0.121.0.

@ConradIrwin Do we have scrolloff support, or not yet?

maxdeviant avatar Jan 31 '24 22:01 maxdeviant

Not yet

On Wed, Jan 31 2024 at 15:12, Marshall Bowers @.***> wrote:

Counts for H and L motions are available in Zed v0.121.0 https://zed.dev/releases/preview/0.121.0.

@ConradIrwin https://github.com/ConradIrwin Do we have scrolloff support, or not yet?

— Reply to this email directly, view it on GitHub https://github.com/zed-industries/zed/issues/4941#issuecomment-1920064568, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXAQATND6ITZEORKDTGQ3YRK6UZAVCNFSM6AAAAABCJFSEU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGA3DINJWHA . You are receiving this because you were mentioned.Message ID: @.***>

ConradIrwin avatar Feb 01 '24 14:02 ConradIrwin

This should've been closed a while back

ConradIrwin avatar Jul 17 '24 02:07 ConradIrwin