Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Fenced Insert #1934

Open
i-am-linja opened this issue Sep 2, 2024 · 0 comments
Open

Request: Fenced Insert #1934

i-am-linja opened this issue Sep 2, 2024 · 0 comments

Comments

@i-am-linja
Copy link

Context

In the original vi, insert mode did not work like a non-modal editor: only characters inserted since entering insert mode could be deleted, and the cursor could not even be moved outside that range. Nearly all navigation and other edit operations therefore needed to be done in normal mode.

Analysis

Commuting through normal mode is annoying, compared to operating from within insert mode; however, it is faster, once it becomes habit. It's the same reason step #0 of a new Vim config is to disable arrow keys immediately. The less is possible in insert mode, the faster the user will ultimately become.

Proposal

A new configuration option, evil-fenced-insert or similar, that when enabled will bound the cursor within the range inserted since entering insert mode, and prevent characters outside that range from being deleted until insert mode ends. Additionally, will prevent any action invoked through C-o from reading or writing any characters outside that range, recursively.

Rationale

Someone more Emacsive than me attempted to achieve this feature in user config. The best solution they could muster was to place beginning and ending marks upon entering insert mode, move them as text is inserted, and adjust the behaviour of commands when between them vs not. Such a solution is maximally brittle, in that the literal entirety of Emacs must be specifically handled. Surely, a much cleaner and more robust solution is possible from within Evil itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant