How to Start Gvim with a Maximized Window

How do I start gvim with a maximized window?

Just like many other Gtk+ apps, gvim understands the parameter -geometry. Try for example

gvim -geometry 500x500

How to maximize vim's windows on startup with .vimrc?

On linux with most window managers and wmctrl installed you can maximize Gvim using the following command:

call system('wmctrl -i -b add,maximized_vert,maximized_horz -r '.v:windowid)

. Note: I am intentionally avoiding -b add,fullscreen mentioned in man wmctrl as it means different thing: at least in fluxbox that means that from now on this desktop you can see only either gvim or something else at a time, not both, and gvim is left without window decorations (not that I really care about them). E.g. if you popup yakuake* gvim disappears until yakuake hides.

* terminal emulator, pops like console in some FPS games

How do I start gvim with a maximized window?

Just like many other Gtk+ apps, gvim understands the parameter -geometry. Try for example

gvim -geometry 500x500

How can I maximize a split window?

With :help [topic] you open up a topic that interests you.

Ctrl-Wo will minimize the other windows (leaving only the help window open/maximized).

(Ctrl-Wo means holding Ctrl press W, and then o)

Howto start gvim with a maximized window from a bash-script in gnome

You could use the -geom(etry) option to match the size with the size of your monitor(s).

gvim -geom 200x50+0+0

Where 200 is the number of characters you can fit horizontally, 50 is the same vertically, and +0+0 indicates zero horizontal and vertical offset from the top-left corner of the screen.

Note that the window would not be maximized per se, it would only be (approximately) the same size as your display.

How can I temporarily make the window I'm working on to be fullscreen in vim?

If I understand what you're asking, I think you'll find the ZoomWin plugin helpful (GitHub). If you've got a bunch of split windows, and you want to temporarily make the current window the only visible one, you can hit <C-w>o. When you want to revert to the previous split state, hit <C-w>o again.

[Edit] Note on key mappings:

The default key mapping for this plugin is <C-w>o, but that conflicts with a default Vim key mapping. By default, that does :only, which makes the current window the only window. If you'd like to retain that functionality, you can remap ZoomWin to another key. I remap it to <C-w>w, because I like to use the :only option as well. Here's my mapping:

nnoremap <silent> <C-w>w :ZoomWin<CR>

Note that this also overrides a default Vim mapping, related to moving to other visible windows (:help CTRL-W_w), but I never used that one anyway.

Maximize window in MacVim on startup

You can set the lines and columns options. Just use “very large” values and Vim will truncate them to the largest possible values for your screen and font sizes. If you put this in your ~/.gvimrc, then your initial window will automatically be sized accordingly.

set lines=999 columns=9999

See :help 'lines' and :help 'columns' for the details.


MacVim also has the fullscreen and fuoptions options (along with the “Prefer native full-screen support” checkbox in the Advanced section of the MacVim > Preferences… dialog) that you might find useful.

Vim's mksession doesn't save window maximized state

You can use the SessionLoadPost autocmd to do additional work after you load a session.

augroup more_lines
autocmd!
autocmd SessionLoadPost * set lines=999
augroup END

For more help see:

:h 'lines'
:h SessionLoadPost


Related Topics



Leave a reply



Submit