18

Is there a way to turn gvim into fullscreen mode? I know that this is possible on OS X through MacVim, but wasn't able to find a way to do it on Ubuntu.

8

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.

This doesn't work unless the Enable Extra WM Actions plugin is checked in the Compiz Settings Manager

  • 4
    Thank you, that did it for me. Just for folks who don't know how to do this the exact steps I followed are: - Click on System -> Preferences -> Keyboard Shortcuts - Go to the Window Management category - Select Toggle full screen mode and apply the F11 shortcut – Khaja Minhajuddin Aug 13 '10 at 6:59
  • 4
    I've bound F11 to be the full screen key but when I press it in gVim, the window just flashes and nothing happens. It works in other apps. What am I doing wrong? – miloshadzic Dec 15 '10 at 11:56
9

The system settings do not work for me on Ubuntu 12.04 (as happens to miloshadzic) because gvim catches the F11 key and does not pass it on to the system.

There is a solution though, that I found in this blog

make sure you have wmctrl installed. If you have that, then add the following to your vimrc:

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

And on save of the .vimrc and restart of gvim F11 now has the desired effect.

3

For XFCE Users: Alt+F11 works out of the box

0

You can also switch into fullscreen mode by changing the lines and columns settings. Try to put this into your vimrc:

if has('gui_running')
    set lines=999 columns=999
endif
0

Maximised window instead of fullscreen

If you have a right-side XFCE launcher panel, the fullscreen option of wmctrl causes gvim to overlap.

Below variant with maximized_vert,maximized_horz resolves this issue and enables F11 for maximised window toggling:

command! Maximised :call system("wmctrl -ir " . v:windowid . " -b toggle,maximized_vert,maximized_horz")
noremap  <silent> <F11> :Maximised<CR>
vnoremap <silent> <F11> <C-C>:Maximised<CR>
inoremap <silent> <F11> <C-O>:Maximised<CR>

Automated, upon starting gvim

Place the following line in gvimrc, for a foolproof fullscreen at gvim startup:

autocmd GUIEnter * call system("wmctrl -ir " . v:windowid . " -b add,maximized_vert,maximized_horz")

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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