VSCodeVim / VSCodeVim/Vim

Underscore being ignored in `editor.wordSeparators`

Open
#6,052 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug

Underscores, "_", cannot be used as word separators for vim commands, even though they work with VSCode commands.

To Reproduce
Steps to reproduce the behavior:

  1. Go to settings and change Editor: Word Separators from default:
`~!@#$%^&*()-=+[{]}\|;:'",.<>/?

to

`~!@#$%^&*()-=+[{]}\|;:'",.<>/?_

(underscore added at end)

  1. Open a text editor pane and add the text: word1_word2
  2. In edit mode, place the cursor on the first "w" of the string added in step prior and issue the vim "delete word" command with keystrokes d w
  3. Observe the entire string is deleted.
  4. In edit mode, issue the undo command, u to restore the string from step 2.
  5. Again with the cursor on the first "w" of the string created in step 2, open the VSCode command palette and issue the command Delete Word (@command:deleteInsideWord).
  6. Observe that only the text word1 is deleted, leaving the remainder of the test string as _word2.

Expected behavior
Underscores should be able to be defined as word boundaries.

Screenshots
NA

Environment (please complete the following information):

  • Extension Name: vim
  • Extension Version: 1.18.5
  • OS Version: Windows_NT x64 10.0.18363
  • VSCode version: 1.52.1

Additional context
NA

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Vim delete-word command dw and how it uses the VS Code editor.wordSeparators setting; compare its behavior with @command:deleteInsideWord using the reproduction steps. Done means adding _ as a configured separator makes dw delete only word1, leaving _word2.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.