18

Being a user of GUI editors (mostly Sublime Text) and one simple CLI editor (nano), and just having gVim (the GUI version of vim) installed on my Windows 10, I can't figure out how to adjust this powerful editor to my HiDPI (282.42 PPI eXtra High density according to calculator) display of size 15.6 inches with resolution 3840 x 2160 and scaling set on 250%?

It currently looks like this (scaled down to 40% of taken screenshot to reflect my display scaling, so it only looks blurry to you, but hopefully you get my point) - the text is so small that it is impossible to work with:

gVim on HiDPI

How to adjust gVim to my HiDPI display scaling on Windows 10?

2 Answers 2

21

I'm on Windows 10, update 1909, and I've resolved this by overriding high DPI settings for gVim to System(Enhanced). Setting GUI font size did not help.

Right click on gVim icon -> Properties -> Compatibility -> Change high DPI settings -> check box "Override high DPI scaling behavior" in the bottom of the dialog window and set "Scaling performed by:" to "System (Enhanced)"

4
  • Interesting that Google directed my "gvim blurry on second monitor" search here. This answer 100% solved my problem but it doesn't answer the OP's which used "blurry" in a different context.
    – rshdev
    Commented Jul 1, 2020 at 18:21
  • I wonder why is this not programmatically detected and adjusted in gVim
    – Charbel
    Commented Mar 31, 2021 at 10:53
  • gVim could opt into this using a manifest with the gdiScaling setting (docs.microsoft.com/en-us/windows/win32/sbscs/…), maybe someone should send a patch. Commented Dec 4, 2021 at 22:18
  • I'm on Windows 11 22H2 (build 22621) and, unfortunately, this setting has no effect for me. I tried all settings of the High DPI dialogue, in fact, and even setting them for all users, but there was no change. (I'm on an HP ZBook Fury 16 G9 with a 3840×2400 pixel screen and Intel UHD graphics). Commented May 17 at 15:40
12

On Windows, the configuration file of gVim is named:

_vimrc

It is placed in the installation directory, the default being:

C:\Program Files (x86)\Vim

To edit the file you first need to launch some text editor As Administrator.

And then open the above mentioned file.

Just add something similar to this:

if has('gui_running')
  set guifont=Consolas:h10
endif

where the important parts are both:

  1. The name of font, you may choose any suitable font except for the default, which is:

    Fixedsys

    as this font can only be sized to 4 or 5.

  2. h10 determines its size; in my case 10 is adequate.

1
  • This has solved the text size and readability issue for me, the only pity is that I still have eensy-weensy toolbar icons :) Commented May 29 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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