Skip to content

Supporting '_' or '^' and '$' to move to the beginning and end of the logical line in Vi mode #795

@springcomp

Description

@springcomp

Currently, the ^ key moves the cursor to the first non-blank character of the input.
Likewise, the $ key moves the cursor to the very end of the input.

I would prefer those keys to be restricted to movements in the current logical line of a multi-line buffer.

vi_movements

I have prepared an implementation to this effect, but this touches the GotoFirstNonBlankOfLine and MoveToEndOfLinemethods.

https://github.com/lzybkr/PSReadLine/blob/274381a89e937d70d9fb1b4f77c7cbf38909db8e/PSReadLine/Movement.vi.cs#L194-L207

https://github.com/lzybkr/PSReadLine/blob/274381a89e937d70d9fb1b4f77c7cbf38909db8e/PSReadLine/Movement.vi.cs#L150-L156

What I'm concerned about is that those methods are public and probably relied on in existing scripts. Furthermore, the documentation for the MoveToEndOfLine method specifically states that it moves the cursor at the end of the input.

What could be the best way to introduce such a change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions