Neovim-qt: Can't start maximized

Created on 20 Dec 2015  路  19Comments  路  Source: equalsraf/neovim-qt

I am using neovim with qt-neovim (linux arch). On gvim i could launch a maximized window with:

if has("gui_running")
    set lines 999 columns 999
endif

That is not working now tho. I tried removing the condition with no success.
Is there any way i can achieve that?

Most helpful comment

From #114 call GuiWindowMaximized(1) to set as maximized. The current state in g:GuiWindowMaximized.

@khalidchawtany for fullscreen its the same, just replace with GuiWindowFullScreen

All 19 comments

After restarting somehow it is reading the command, however it doesn't restrict the max size to my screen size, it creates a giant one.

if has("gui_running") is not reliable right now (see neovim/neovim#3646)

however it doesn't restrict the max size to my screen size, it creates a giant one.

This is strange, should not happen, will have a look.

Yeah, i read on some other issues that has("gui_running") is not reliable, so i tried without it too.

The problem is vimrc will likely be processed before the gui even starts, so its all a matter of timing.

Any workaround for this? Anything i can help with on this issue?

@cdvv7788 not forgotten, I've got a working command line options for this in #109, but maybe we can do something similar with a global option

109 was merged, --maximized should start a maximized window. From what we have seen so far using set lines/columns is not a good way to do this, but we can finally start looking at other ways to do this.

leaving a comment to be notified of anything new on toggle full screen command :)

Starting to look at this on #114 (script)
Any idea what are the right semantics for this type of stuff

  • are these supposed to be functions like foreground() or actual commands?
  • Do we want toggle or explicit commands GuiMaximize vs GuiMaximizeToggle
  • Have no idea how we are supposed to share state, ideally set g:GuiIsMaximized (because that sounds easy enough :D)

Pushed something into #114

If testing directly from a source build use this for now

bin/nvim-qt -- --cmd "set rtp+=../runtime/ | runtime autoload/nvim_gui.vim"

init.vim looks like this

" We can check first if the following commands are available, but the last one is just a var anyway
if exists('g:Gui')
    Guifont DejaVu Sans Mono:h15

    " Starts in fullscreen, Maximized should work too (untested)
    let g:GuiWindowFullScreen=1
endif

From #114 call GuiWindowMaximized(1) to set as maximized. The current state in g:GuiWindowMaximized.

@khalidchawtany for fullscreen its the same, just replace with GuiWindowFullScreen

Lovely, Thanks. :+1:

Using call GuiWindowMaximized(1) command inside nvim-qt works great. Can we also use it inside ginit.vim?

Hi @jdhao. It should work inside ginit.vim as well. Are you having issues with it?

@equalsraf It works. Thanks!

How do I go about discovering such handy commands for nvim-qt? Such as GuiFullScreen and GuiWindowMaximized? So useful to know that I can toggle inside of Vim and it works in init.vim!!

@dseeni these are described in the docs. Just call :h nvim-gui-shim.

@equalsraf,
hmm, odd.. I can't get the docs on windows 8.1 .. but clearly the commands work...speaking of which.. noob question:
Is there any advantage for me compiling it? I'm just using an executable from the releases page...

Is there any advantage for me compiling it? I'm just using an executable from the releases page...

Same as every other piece of software, you get to test the newest changes and broken bits before anyone else :D.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamkarlson picture iamkarlson  路  6Comments

DustinVenegas picture DustinVenegas  路  10Comments

skywind3000 picture skywind3000  路  7Comments

legendre6891 picture legendre6891  路  3Comments

gqqnbig picture gqqnbig  路  7Comments