macvim-dev / macvim-dev/macvim

Get the current window's screen info

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

Nobody has claimed this yet.

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

Description

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

Background: I have multiple machines and two screens on one of them. On my main machine, on the secondary screen where I usually run MacVim, I have my font to :h16, but I need it at :h12 (or so) on my main laptop screen (or on my secondary machine where there is no secondary screen).

Describe the solution you'd like

I would like to be able to have a function in MacVim return the current window's screen information—screen width / height in pixels, screen name, other details; similar to the output of system_profiler SPDisplaysDataType:

Graphics/Displays:

    Apple M4 Pro:

      Chipset Model: Apple M4 Pro
      Type: GPU
      Bus: Built-In
      Total Number of Cores: 16
      Vendor: Apple (0x106b)
      Metal Support: Metal 3
      Displays:
        Color LCD:
          Display Type: Built-in Liquid Retina XDR Display
          Resolution: 3024 x 1964 Retina
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Automatically Adjust Brightness: Yes
          Connection Type: Internal

If possible, it would be nice to have an event (WindowScreenChanged or something like that) which could be used to trigger when the window has been moved to a different screen or the screen has been resized or something.

Describe alternatives you've considered

I don't think that there are alternatives which let me know which screen the current window is on, even if some of this could be executed via osascript.

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

No files or tests are named. Start by locating MacVim's window and screen integration, then review how Vim functions and window events are exposed; done should include a callable way to retrieve the current window's screen details and, if feasible, notification when its screen changes.

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.