Skip to content

Introduce a move command for moving cursor in the editor #9143

@sandy081

Description

@sandy081

Introduce a move command for moving cursor at a logical view position in the editor

This will allow the extension writers to place the cursor at a provided position in the editor

Usage:

  • Command Id: cursorMove
  • Arguments: {to: $ViewPosition, select: boolean, by: $By, value: number}
  • Defaults: value = 1. by based on to value.

ViewPosition

  • left: Moves the cursor left by n characters.
  • right: Moves the cursor right by n characters.
  • up: Moves the cursor up by n lines or wrapped lines.
  • down: Moves the cursor down by n lines or wrapped lines.
  • wrappedLineStart: Places the cursor at the start of the current line in the view.
  • wrappedLineFirstNonWhitespaceCharacter: Places the cursor at the first non white space character of the current line in the view.
  • wrappedLineEnd: Places the cursor at the end of the current line in the view.
  • wrappedLineLastNonWhitespaceCharacter: Places the cursor at the last non white space character of the current line in the view.
  • wrappedLineColumnCenter: Places the cursor at the center of the line in the view.
  • viewPortTop: Move the cursor to the first non white space character of Nth line from the top of the view.
  • viewPortCenter: Move the cursor to the first non white space character of the center line of the view.
  • viewPortBottom: Move the cursor to the first non white space character of Nth line from the bottom of the view.

By

  • line - Default for line specific commands
  • wrappedLine
  • character - Default for character specific commands
  • halfLine - Only for character specific commands.

Set select arg to true, to select text for above

Metadata

Metadata

Assignees

Labels

VIMVIM issueapifeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions