Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.



I would like to open gVim in full screen mode, i.e. without upper and lower panes.
I try to achieve it editing

System -> Preferences -> Keyboard shortcuts->Window management -> Toggle fullscreen mode

but the shortcut doesn't work in any application.

How can I achieve it?

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

Under the metacity window manager, fullscreen display should work with the standard shortcut defined as you describe in your question, but if you have anything other than "None" selected under System -> Preferences -> Appearance -> Visual Effects, you'll get the compiz window manager. I couldn't find a way to make the full screen shortcut work there either.

You could use the wmctrl utility to send a manual request for full screen mode.

wmctrl -r gvim add,fullscreen

And to revert:

wmctrl -r gvim remove,fullscreen

This works from within Vim as well, so you can map e.g. F11 to toggle full screen mode:

map <silent> <F11>
\    :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen")<CR>

To get the complete fullscreen effect, you can hide tool and menu bar:

set guioptions-=T guioptions-=m

I personally wouldn't miss them but if you do prefer to have them in non-fullscreen, you'd probably best handle the toggling inside a function. (Check the edit history for an example.)

Finally a default setting you may have tweaked as you speak of a bottom pane is 'laststatus'. Reset it to not show the status line when there is only one window:

set laststatus&

Or preferably find where it's set to non-default in your .vimrc and remove it there.

share|improve this answer
1  
You could also write this instead of ToggleFullscreen: map <silent> <F11> :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen")<CR> –  Daan Mar 3 '13 at 20:48
    
Much better! Replaced the function with your mapping. –  user112553 Mar 7 '13 at 23:39
add comment

If you set

set columns=120
set lines=40

in your .gvimrc you will get a gvim of the specified size. IIRC from the vim manpage, gvim will never create itself bigger than your screen, so setting these to very large values will create an essentially fullscreen gvim.

share|improve this answer
add comment

On gvim 7.2, I was not able to use the method of user112553 as v:windowid is not supported. However, this also works, and probably easier:

:exe "!wmctrl -r ".v:servername." -b toggle,fullscreen"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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