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

That is not working now though. I tried removing the if without success. Is there any way I can achieve that?


2 Answers 2


Try putting

call rpcnotify(0, 'Gui', 'WindowMaximized', 1)

in your ginit.vim. I haven't tested on Linux, but it works on Windows 7.

  • 1
    This answer works on the Xubuntu LTS 18.04 GNU/Linux distribution. Commented Sep 23, 2018 at 23:35

The reason seems to stem from the fact that neovim sets gui_running only after your .vimrc is sourced (see here). In this discussion it is proposed to use the GUIEnter event, thus a solution could be

autocmd GUIEnter * set lines=999 columns=999
  • 1
    Didn't work. Maybe event is not being called.
    – cdvv7788
    Commented Mar 21, 2016 at 23:42
  • @cdvv7788 does invoking vim with --cmd 'let gui_running="y"' together with setting columns and rows inside an if using if exists('gui_running') work?
    – Ingo
    Commented Mar 22, 2016 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.