11

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 though. I tried removing the if without success. Is there any way I can achieve that?

2

2 Answers 2

6

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
  • 1
    This answer works on the Xubuntu LTS 18.04 GNU/Linux distribution. Sep 23, 2018 at 23:35
2

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
2
  • 1
    Didn't work. Maybe event is not being called.
    – cdvv7788
    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
    Mar 22, 2016 at 19:26

Your Answer

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

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