How do you change the font size in neovim? - vim

I only case about the font size, I want nothing to do with the font other than its size set guifont makes me put in a font, therefor its useless to me.
Update: all of the answers here weren't what I was asking for but I gave up on trying to fix it and moved on to using vim on Cmder.

For nvim-qt used in Windows, the following command works after nvim-qt has started:
execute join(["GuiFont! ", split(GuiFont, ":")[0], ":h14"], "")
With your font size in place of 14.
To set the font size at start, you have to use ginit.vim instead of init.vim, since init.vim starts before the GUI is loaded. Location of ginit.vim is C:\Users[User]\AppData\Local\nvim.

Related

Godot script editor font won't change despite setting new ttf file

I can't seem to change the font in Godot's script editor. I want to change it to the monaco_linux.ttf I downloaded. I've specified which file to use, but the font only seems to increase in size a bit when I set it.
How can I change the font in Godot's script editor?
Editor Font Setting:
Editor >> Editor Settings >> Code Font >> Path/To/ttf
It seems like the font wasn't working because I was trying to use size 14 font. When I switched to size 16, it worked fine..

fvwm gvim menu size smaller than text size

I am new to fvwm machine which is used by my new employers.
I am struggling in customizing gvim menu (File, Edit,etc) font size.
As you can see in the attached image, the font size are decent, but menu size is pretty small as compared to text font size.
How to solve this??
Reference Image:
gvim uses gnome gtk in the gnome version of gvim and in this case you can configure your environment using a .gtkrc file see https://unix.stackexchange.com/questions/25043/what-is-this-gtkrc-file. As another answer pointed out for Gtk 2.x programs ~/.gtkrc-2.0 is the configuration file.
To modify your font see e.g.
https://ubuntuforums.org/showthread.php?t=846348
https://bbs.archlinux.org/viewtopic.php?id=164044
https://unix.stackexchange.com/a/478303/38701
examples:
gtk-font-name = "Sans 12"
which gives you a Sans-Serif font with size 12
gtk-font-name = "DejaVu Sans 11"
which is more specific regarding the font and uses size 11
Create .gtkrc-2.0 in your home directory if it isn't present already
and add:
gtk-font-name = "bitstream bold 16"
That should solve your problem.

Powerline/arrowline arrows are too small in urxvt

I first tried to install powerline on my computer and had problems with the arrows not rendering correctly which was easily corrected by installing a patched font. However, although the arrow symbols were rendered correctly they were much smaller than they were supposed to be.
This problem persisted when I switched from powerline to airline. I found that the problem only existed in urxvt. Gnome-terminal rendered the arrow size correctly, but placed the arrows where offset slightly from their proper positions on the line.
Here are the relevant entries in my ~/.vimrc file:
set termfont=Liberation\ Mono\ for\ Powerline\ 10
let g:airline_powerline_fonts = 1
This patched fonts method is a fallback method which works for every terminal, with the exception of rxvt. It is not about the powerline theme, it is about the font size. It doesn't work with 10. Possible solutions can be found here or here.

Why doesn't gvim set the font correctly?

I am trying to configure gvim font on linux in .vimrc but it produces strange results.
To make gvim use "Liberation Mono" I added set guifont=LiberationMono: h12. It gets applied but does not recognize :h12 option and output:
Error detected while processing /home/tastyminerals/.vimrc:
line 44:
E518: Unknown option: h12
But I am ok with the result since the font gets applied.
However when I correct the line to set guifont=LiberationMono:h12 gvim does not complain but the font gets changed to this:
This is not "Liberation Mono" of course, this thing happens with any other font I try to use.
Why does the font get changed to some strange monospaced variant? How can I configure the font correctly?
I managed to resolve the issue by correcting the font setting in ~/.vimrc
set guifont=LiberationMono\ 12

List of fonts available in gvim

I know I can set fonts for gvim using something like set guifont=Menlo\ Regular:h14. I have the following questions
Is there a wiki where I can see what all fonts are supported?
I want to set my font to "Lucida Sans Typewriter". I tried set guifont=Lucida Sans Typewriter\ Regular:h14, but it gave me an error when I opened a file using gvim. Error is "E518: Unknown option: Sans"
I also tried to increase the font size using set guifont=Sans\ Regular:h14, but looks like it is stuck at font size 11. I am trying this on macvim.
You need to backslash all of the spaces in the font name, not just the last one.
You can :set guifont=* to open a font chooser with the fonts available on your system. Then after you pick one you like you can :set guifont? to read back the value you need to put in your .vimrc.

Resources