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?

link|improve this question

80% accept rate
feedback

2 Answers

up vote 2 down vote accepted

Under the metacity window manager, full screen 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 even works from within Vim, so you could map e.g. F11 to toggle full screen mode like this:

function! ToggleFullscreen()
    if g:fullscreen == 1
        let g:fullscreen = 0
        let mod = "remove"
    else
        let g:fullscreen = 1
        let mod = "add"
    endif
    call system("wmctrl -ir " . v:windowid . " -b " . mod . ",fullscreen")
endfunction

map <silent> <F11> :call ToggleFullscreen()<CR>

To get the full fullscreen effect, you could also hide gVim's tool and menu bars:

set guioptions-=T guioptions-=m

I generally don't use either, so I wouldn't miss them. If you do want them in non-fullscreen, though, it will be a little more complicated to toggle.

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's only a single window:

set laststatus&

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

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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