VSCodeVim / VSCodeVim/Vim

Support Vim's flavor of regex

Open
#3,996 10 comments 19 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We currently use javascript's regex library, which is unfamiliar to some coming from vim (see #2043, #3073, #3075, etc.). This ticket is to consolidate those and center discussion around the possibility of supporting Vim's regex flavor.

As a first step, I've created the Pattern class with its own parser - this essentially just translates a Vim-style regex into a JS-style regex.

Current status:

  • \</\> => \b (technically, this is not quite right)
  • Deal with \n on Windows (allow leading \r)
  • Capture groups (\1, etc.)
  • Character classes (:help /character-classes)
  • magic (#4018)
  • \%V (#4936)
  • \zs and \ze (#3073)
  • Branches (:help /branch)
  • Many other weird little quirks

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 inspecting the existing Pattern class and its parser, then review the linked issues and the unchecked regex features in this ticket. Done means agreeing on and implementing the remaining Vim regex behaviors, including character classes, magic, %V, \zs/\ze, branches, and other documented quirks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.