python / python/cpython

Add vi mode to pyrepl

Offen
#141,374 2 Kommentare 11 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

stdlib topic-repl type-feature
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Feature or enhancement

Proposal:

Since PyREPL implements its own readline mechanism, vi mode is not supported anymore unless the user reverts to the old REPL using PYTHON_BASIC_REPL. This comes up from time to time in issues like #118840 or #127706.

I propose a simple vi mode implementation directly in PyREPL which offers basic motion and editing functionality. This should reduce friction for users who prefer to use vi editing mode and are forced to rely on the old REPL for this. Achieving feature parity in this regard with the old REPL might also help fully removing the old implementation.

I can submit a PR with a basic implementation for review, which adds motions and simple editing commands. It still requires adding yank & paste, undo, linewise commands, etc. which I'm happy to implement if PyREPL code owners are happy to move forward with the feature and the design looks reasonable.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs
  • gh-141375

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Untersuchung von PyREPLs readline-Mechanismus und der alten REPL, die von PYTHON_BASIC_REPL ausgewählt wird, und lies anschließend den verknüpften PR gh-141375. Für den Abschluss wäre ein abgestimmter grundlegender vi-Modus mit Bewegungs- und Bearbeitungsbefehlen erforderlich; Yank und Paste, Rückgängigmachen sowie zeilenweise Befehle sind ebenfalls als verbleibender Umfang identifiziert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.