How to change the default font of gVim

1

1

Edit: I moved the original question to 'The docked gVim in Windows 7 jumps upon tab switch'

After struggling with my .vimrc, I am resorting to setting the font from windows registry instead, because without the guifont in .vimrc, everything works fine. The only registry mentioned I found was,

HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Console\TrueTypeFont

This is for MS command line, but it was not what I was looking for. Currently gVim is set to Fixedsys by default. The search though the registry for value fixedsys returned no result. My gut feeling is that one can change it through the registry setting. Is there such registry value?

Forethinker

Posted 2013-04-16T21:04:02.873

Reputation: 640

This may not be exactly what you want, but you might consider using standard vim (non-gui) in Windows. Using more high quality console replacement such as console 2 will give you the usual VIM experience, and you should be able to use any font you like.

– Fopedush – 2013-04-16T21:40:41.390

Could you please clarify the question? More specifics on what happens versus what you expect, what sequence of commands you are using to reload the file, which settings are in vimrc versus gvimrc, stuff like that. If you are not already putting your gui initialization in a separate gvimrc, try that first. – Bradd Szonye – 2013-04-16T22:33:38.117

@Fopedush I already use non-gui vim through mintty, but the advantage of gVim is +clientserver option. Also if you use vimperator with firefox, you can also edit text fields easily with ctrl-i shortcut. This is not possible with vim. – Forethinker – 2013-04-17T00:54:32.267

@BraddSzonye I clarified the question. I do not think it is the conflict with the .vimrc (mine is quite big) and I did test it thoroughly. The auto source of .vimrc and guifont is all it takes to trigger the behavior. – Forethinker – 2013-04-17T01:09:01.100

Thanks. A good next step would be to create a minimal vimrc that reproduces the problem. Does the window become undocked if you use a vimrc that contains nothing but a guifont setting? – Bradd Szonye – 2013-04-17T01:15:18.760

Also, you might have better luck asking "how to fix this?" rather than "how to set this in the registry?" in case there's a better solution, or if the problem also happens to people on non-Windows version of vim. – Bradd Szonye – 2013-04-17T01:17:51.267

Answers

2

The font was hardcoded into the binary of gvim.exe and vim.exe. I just search and fine through the binary for 'Fixedsys'. I changed that portion to with the name of font I wanted and it was all good. Any editor will do, but I used another vim (non-gui, cygwin) in this case, because vim is very good for opening a massive file. I did not need to recompile

Forethinker

Posted 2013-04-16T21:04:02.873

Reputation: 640

1Did you recompile it or hack the binary? Any details you could offer to help people who want to accomplish the same thing? – Bradd Szonye – 2013-04-17T23:23:15.087