-
Notifications
You must be signed in to change notification settings - Fork 39
Description
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: