macvim-dev / macvim-dev/macvim

Add an option so that opening a file from macOS’s "external editor" mechanism does not bring macvim to foreground

Open
#1,408 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

In macOS, I am setting the default editor for source code files to open with macvim be default so that macvim can be the editor when debugging on lldb with lldb --editor. However, whenever a breakpoint is hit, or a frame changed, the focus automatically goes from lldb to macvim. I wish I could keep the focus on lldb instead.

Describe the solution you'd like

Maybe there could be an option called macvim_dont_bring_to_foreground, set to 0 by default, that enables the current behavior (bringing macvim to foreground when a remote command arrives), and can be set to 1 to disable the foreward bringing).

Describe alternatives you've considered

I have considered using vim in the terminal instead, by the server part of +clientserver is disabled.

Additional context
Add any other context or screenshots about the feature request here.

EDIT: lldb don’t use $EDITOR but the host’s external editor instead.

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 tracing MacVim’s macOS external-editor or remote-command handling and where it activates the application when a breakpoint or frame changes. Done means a configurable option preserves the current foreground behavior by default while allowing remote file openings to leave lldb focused; verify this through the external-editor workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, vim
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.