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

Add macaction to maximize the window. #885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

digicannon
Copy link

Many Vim users, myself included, prefer to start Vim in a maximized window state. For this, I have added the performMaximize: macaction. This allows the following to be added to a vimrc:

autocmd GUIEnter * macaction performMaximize:

@chdiza
Copy link
Contributor

chdiza commented Apr 25, 2019

Is this different from the already-existing performZoom:?

Also, what's wrong with just doing the following?

autocmd GUIEnter * set lines=999 columns=999

@juliuszint
Copy link

There is also the possibility to add the following line to your .gvimrc
:set fullscreen

@digicannon
Copy link
Author

There is also the possibility to add the following line to your .gvimrc
:set fullscreen

Maximize is not fullscreen.

@digicannon
Copy link
Author

digicannon commented Apr 25, 2019

Is this different from the already-existing performZoom:?

Also, what's wrong with just doing the following?

autocmd GUIEnter * set lines=999 columns=999

performZoom: usually only enlarges the window to match the height of the screen, not the width. The size it chooses depends on what the user last resized it to.

That autocmd does work 100%, but it feels hackish to me. I'd prefer a more clear command.
maca performMaximize: is a much more simple command to type if your window is already open.

@eirnym
Copy link
Contributor

eirnym commented Apr 26, 2019

AFAIK, MacVim preserves last used size if nothing changes it manually.

Returning to your implementation, I'd prefer to make it to restore "last used size if maximised" like it was done in performZoom:.

@ychin
Copy link
Member

ychin commented Apr 28, 2019

I'm hesitant to add this because we already have MMZoomBoth that allows you to tell MacVim to default to zoom in both directions to fill the screen. I would imagine most users want MacVim to either always zoom vertically, or in both directions?

What's more concerning is that autocmd GUIEnter * macaction performZoom: doesn't actually work probably because or ordering issues. Does your code using performMaximize: actually work reliably even if you open multiple windows using Cmd-N?

Edit:

Also, we should probably not call it "perform"-something as that's a macOS thing. "performZoom:" means pretend to hit the zoom button. We already have a macaction called zoomAll:. Maybe we just need one called zoom: (or maybe zoomBothDirections: if we really want it) that's a little more robust than performZoom:.

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

Successfully merging this pull request may close these issues.

5 participants