In gvim setting font size to 12 is not permanent and it is reverting back to 10 when I open gvim again

I am using Xubuntu 16.04

In gvim, by going to Edit ---> Select font I am selecting the font size 12. But after I close gvim and open gvim again I see that the font size has gone back to 10.

How can I set the font size to 12 permanently?

8

1 Answer

You can set the GVim font in either your ~/.vimrc, or in ~/.gvimrc using:

set guifont=Ubuntu\ Mono\ 13

However, if you use ~/.vimrc, then you need to ensure that it is only run for GVim, and not for regular command-line Vim:

if has("gui_running") if has("gui_gtk2") set guifont=Ubuntu\ Mono\ for\ Powerline\ 13 endif
endif

See :h 'guifont' for more.

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like