VSCodeVim / VSCodeVim/Vim

Return to normal mode if the focus is lost

Open
#8,012 4 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

I'd like to return to normal mode, if the focus is lost. How can this be accomplished?
The vim-command
autocmd FocusLost * call feedkeys("\<esc>")
(or autocmd FocusLost, TabLeave * call feedkeys("\<esc>"))
automatically returns to normal mode, if the focus is lost.

We'd appreciate the same functionality in VSCodeVim.
Thank you!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the VSCodeVim entry points that handle editor focus changes and mode transitions, then compare their behavior with the FocusLost and TabLeave Vim commands shown in the issue. Done means focus loss reliably returns VSCodeVim to normal mode, with coverage for the requested focus scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.