Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Cursor State CheckerNew to Visual Studio Code? Get it now.
Cursor State Checker

Cursor State Checker

tokoro-it

|
31 installs
| (0) | Free
Checks the state of the cursor (BOL or EOL or left and next to specific characters).
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Cursor State Checker

日本語版README

Features

Checks the cursor's position in the editor and sets the context.
You can use these contexts in when conditions for keyboard shortcuts.

Here is the English translation:

State Context Key Characters to Check
The area to the right of the cursor is normal (not at the beginning of the line, no specific characters) CSChecker.normalLeft
The area to the left of the cursor is normal (not at the beginning of the line, no specific characters) CSChecker.normalRight
The cursor is at the beginning of the line CSChecker.bol
The cursor is at the end of the line CSChecker.eol
The character to the left (previous) of the cursor is a specific character (quote, bracket/tag) or a space followed by a specific character CSChecker.leftIsSpecifiedChar "'``(){}[]<>
Can be changed in settings
The character to the right (next) of the cursor is a specific character (quote, bracket/tag) or a space followed by a specific character CSChecker.rightIsSpecifiedChar "'``(){}[]<>
Can be changed in settings
Usage example of context keys

In normal cases, use cursorWordEndRight to move the cursor word by word.
When a specific character or a space followed by a specific character is to the right of the cursor, you can move to the next character using cursorRight.
When at the end of the line, the default behavior occurs, and a space is inserted.

{
  "key": "shift+space",
  "command": "cursorWordEndRight",
  "when": "textInputFocus && !accessibilityModeEnabled && CSChecker.normal"
},
{
  "key": "shift+space",
  "command": "cursorRight",
  "when": "textInputFocus && !accessibilityModeEnabled && CSChecker.rightIsSpecifiedChar"
}

Status Bar

The cursor position determines the state displayed in the status bar.
By clicking the status bar, you can copy each context key to the clipboard.

Here is the English translation:

Beginning of the Line

status-bol

End of the Line

status-eol

Specific Character to the Left

status-left

Specific Character to the Right

status-right

Clicking the status bar

statusbar-click

Settings

This extension provides the following settings:

Here is the English translation:

Key Description Default Value
check-cursor-state.enabled Enable/Disable the extension true
check-cursor-state.leftOfCursorCheckChars Characters to check to the left of the cursor "'``(){}[]<>
check-cursor-state.rightOfCursorCheckChars Characters to check to the right of the cursor "'``(){}[]<>

Release Notes

  • see CHANGELOG

License

  • MIT
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft