[Feature] Implement Select mode

Aperta
#239 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Start by reviewing the existing API and how vim-visual and vim-insert modes are represented in this CodeMirror Vim integration. Trace how a visual selection is preserved when changing modes, then determine where a global select-mode command belongs for CodeMirror-based editors. Done means the command switches to insert-like behavior while retaining the current selection and keeps select-mode shortcuts separate from visual-mode bindings.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

Implement a command that allows one to switch between vim-visual to vim-insert while keeping the current selection.
Vim originally has a select mode, described at https://vimhelp.org/visual.txt.html#Select. It keeps the current selection mode when switching but for this use case, just being able to switch is enough.

Explanation

Currently in overleaf and obsidian, you can select text and invoke some action upon that text.
For example given the following string in obsidian

|Some important text here|

(where | represents the bounds of the selection)
You can press * to convert it to

*|Some important text here|*

(select mode = vim-insert while having something selected)

The only problem here is that selecting with vim visual mode is much easier than doing it with arrow keys or with the mouse.
And these shortcuts are only available in select mode. I want to keep them only available in select mode as they would otherwise conflict with the visual-mode keybindings.

This can be already implemented with the current api, but as probably most codemirror-based editors will have some selection-based commands, it would make more sense to implement this on a global level.

video for better example:

https://github.com/user-attachments/assets/e3823b2d-6dcc-45c5-a3f7-50fca1e9898a

Lingua principale
JavaScript
Stelle
470
Fork
53
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di replit/codemirror-vim

Tutte le issue di replit/codemirror-vim

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.