Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I start gvim with a maximized window?

Tags:

I would like to start gvim, from the command line, into a maximized window - how can I do this?

I have no wish to always start in a maximized window (that is, not configure it as default in .vimrc), but rather choose to provide a parameter to the program.

That is, running gvim <parameter(s)> should start the program in a maximized window but just running gvim should start the program with the default size.

like image 635
Tomas F Avatar asked Jan 18 '11 09:01

Tomas F


People also ask

How do I get Gvim to open full screen?

vimrc and restart of gvim F11 now has the desired effect. With gnome you can set a shortucut to the "fullscreen" action. Use gnome-keybinding-properties, select Window Managaer and choose Change to Fullscreen, then select a shorcut (F11 for example). This shortcut will set the current Gnome Window in fullscreen mode.

How do I open Gvim files on Windows?

Try typing just "gvim" instead of "start gvim.exe". That works for me. Vim isn't in my path environment variable.

How do I switch between windows in vi?

To move from the current Vim window to the next one, type CTRL-W j (or CTRL-W <down> or CTRL-W CTRL-J). The CTRL-W is the mnemonic for “window” command, and the j is analogous to Vim's j command, which moves the cursor to the next line.


2 Answers

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

gvim -geometry 500x500 
like image 133
grep Avatar answered Sep 29 '22 07:09

grep


For me (I'm on Ubuntu 11.10), adding this to my .vimrc seems to do the trick. No need for geometry settings, etc.

if has("gui_running")   " GUI is running or is about to start.   " Maximize gvim window.   set lines=999 columns=999 endif 
like image 22
Ryan Shillington Avatar answered Sep 29 '22 08:09

Ryan Shillington