Don't move back 1 character when exiting Insert mode
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
To replicate, write a sentence like
hello world
then move the cursor to the end of a line and repeatedly type i, Esc, i, Esc (i.e. enter and exit insert mode). The cursor will eventually end up at the beginning of the line instead of staying where it started.
Describe the solution you'd like
I would like a config option like
"vim.moveCursorBack": false,
that would keep the cursor where it is when exiting insert mode (default to true).
Describe alternatives you've considered
I think I could use NeoVim integration because there's definitely ways of configuring it to behave this way, I think I do it with autocmd InsertLeave * :normal `^. See https://vim.fandom.com/wiki/Prevent_escape_from_moving_the_cursor_one_character_to_the_left#Programmatic_Alternative
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in VS Code by moving to the end of a line and repeatedly entering and exiting Insert mode. Locate the Insert-mode exit handling and configuration declarations, then verify that a new option preserves the cursor position when disabled while the default behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100