Hot answers tagged

62 votes

How can I change the font size in gVim?

If you want to simply change the font size in a running GVim instance, type: :set guifont=* A window should pop up letting you set font size as well as pick a new font if desired. You can then ask ...
pkout's user avatar
  • 721
14 votes
Accepted

How to zoom to text in VIM via shortcut?

If you are using vim in a terminal you can simply use its zoom shortcuts. For Gnome-Terminal this is Ctrl++. In others it may be Ctrl+Shift++. Also there are several plugins out there for this ...
apparat's user avatar
  • 931
10 votes

How can I change the font size in gVim?

Apparently, the way to write the font settings are quite platform-dependent. What worked for me (gVim in MX Linux 17, an XFCE Debian-based Linux distribution): Determine the current font settings in ...
bli's user avatar
  • 201
10 votes

gvim window looks bad

The problem is probably that you don't have the Consolas font installed and that Vim defaults to an ugly default font. Try using a different font, for example this should work on most Linux systems: ...
Martin Tournoij's user avatar
8 votes

How to change Vim's :hardcopy printfont?

Instead of printing from Vim, you could instead generate an HTML file using :TOhtml. Then you can use CSS to set the font used for the HTML and print that.
jamessan's user avatar
  • 11k
7 votes
Accepted

Change a font in Vim/GVim in a simple way

Reading the 'guifont' option is useful here. I do understand your frustrations with this option however. It seems that how you set the 'guifont' setting, is dependent on the OS. On macOS, you set '...
akshay's user avatar
  • 6,447
6 votes
Accepted

How do I create buttons on the toolbar to increase and decrease font size?

I think something along the following lines should work: anoremenu ToolBar.Builtin#31 :let &guifont=substitute(&guifont, '\(\d\+\)', '\=submatch(1)+1', '')<cr> anoremenu ToolBar....
Christian Brabandt's user avatar
6 votes
Accepted

Why do symbols look ugly in gvim?

If you have a recent Vim, you may try to enable DirectX rendering. It should improve "wide" font rendering, among other things. Here's an example vimrc snip: if has("gui_running") set guioptions=...
VanLaser's user avatar
  • 9,680
5 votes

How can I look up the current/default guifont reliably?

So it looks like if no guifont is specified in your vimrc, gVim will use some built in default font and it would not be reflected in guifont -- set guifont is empty. But it turns out it is possible ...
Maxim Kim's user avatar
  • 13.1k
5 votes

How can I change the font size in gVim?

Based on Drew's answer this setup worked better for me. It increases or decreases font-size using \+ or \- (assuming \ is your leader), and cycles through the predefined fonts using cot. I often swap ...
gauteh's user avatar
  • 173
5 votes

Can I use a non-monospaced font in either Vim or gVim?

Proportional fonts are supported in Neovim GUIs such as FVim. The discontinued Oni project also supported this with its "webgl" renderer (see https://github.com/onivim/oni/issues/2359): &...
Justin M. Keyes's user avatar
5 votes

Settings for the font in .vimrc are not working

I had the same problem as the OP after upgrading from Ubuntu 16.04 to 18.04. Turns out the condition if has("gui_gtk2") in _vimc is no longer true, changed it to "gui_gtk3" as a ...
Salvador González's user avatar
5 votes

Settings for the font in .vimrc are not working

Here is a trick what I usually do in a graphical Vim to select a nice looking font. First I interactively set the font using: :set guifont=* This brings up a nice dialog with all the known fonts ...
Christian Brabandt's user avatar
5 votes

How to get emoji completion in markdown with `:<emoji>`, using neovim and coc

One way to get this feature is by using coc and coc-emoji. Coc is a plugin which allows you to get the same Language Server Protocol (autocompletion, linting, go to definition, etc...) as VSCode ...
statox's user avatar
  • 49.6k
4 votes

How to change Vim's :hardcopy printfont?

I don't know when it changed, but now it's possible. For example: :set printfont=Fira_Code:h12 :hardcopy do the job. I'm using Vim 9 on Windows. (P.S. I will try with MacVim in a few days and I'll ...
Antonio's user avatar
  • 277
4 votes
Accepted

Settings for the font in .vimrc are not working

Since font is specific to the GUI versions of vim (i.e. gvim and macvim), you need to should put the set guifont=... line in your gvimrc. A good place for that is ~/.vim/gvimrc, but you can read ...
D. Ben Knoble's user avatar
  • 25.8k
4 votes

How to change font style in Linux terminal?

To change the font used by terminal Vim or Neovim, you need to change the font the your terminal emulator uses. The exact settings vary between different terminal emulators. For example, if you are ...
jdhao's user avatar
  • 1,113
4 votes
Accepted

changing font size leaves white bars in gvim

First: I have no experience with i3wm. So my observation from "normal" windows manager. Vim is working with monospaced fonts. So every character is displayed in a box with a certain width ...
Ralf's user avatar
  • 9,157
3 votes
Accepted

Set gui's font in win7

See: :help guifont: [...] The font name depends on the GUI used. [...] For the Win32 GUI takes these options in the font name:> hXX - height is XX (points, can be ...
Rich's user avatar
  • 31.7k
3 votes
Accepted

powerline font/symbol glitches

There are several ways to install the elements such as the solid right arrows in your screenshot. Two are described here: Powerline fonts installation. One approach involves installing symbol fonts ...
B Layer's user avatar
  • 19.7k
3 votes

How to display Font Awesome in Vim?

Console Vim is using the font from the console terminal. You can use Inconsolata Nerd Font, which includes FontAwesome glyphs. For example, in urxvt including the following: URxvt.font: xft:SF Mono:...
christok's user avatar
3 votes

How can I change the font size in gVim?

You can try this plugin:vim-fontzoom. map <m-o> :Fontzoom!<cr> map <m--> <Plug>(fontzoom-smaller) map <m-=> <Plug>(fontzoom-larger)
tracyone's user avatar
  • 345
3 votes

Latin Capital Letter Thorn

The answer was posted in the comments by @DJ McMayhem. :set enc? latin-1 So by changing it to utf-8 the text becomes readable. :set enc=utf-8
Martin York's user avatar
  • 6,492
3 votes
Accepted

Discover which fallback font was used in gvim

If there really isn't a simple query to find the information then we'll have to brute-force it... Two key behaviors are described in :h 'guifonts': [If a list of fonts is given] the first valid ...
B Layer's user avatar
  • 19.7k
3 votes

Settings for the font in .vimrc are not working

Create/modify a file called.gvimrc in your home directory and add set guifont=DejaVu\ Sans\ Mono\ Book\ 12. Restart gvim to take effect.
Tonnemanski's user avatar
3 votes
Accepted

changing fonts in vimrc

To specify the font size you need to prefix the size with an "h", so the correct command would be :set guifont=Courier:h14.
Jürgen Krämer's user avatar
3 votes

Display superscript of multiple characters to express a mathematical exponent

Vim only ships digraphs for the superscripts for 1 through 3. You can find the additional superscripts for 4 through 9 and 0 in the Unicode ranges U+2074 through U+2079 and U+2070, which you can ...
filbranden's user avatar
  • 28.7k
2 votes

gvim incorrect font (or encoding) in menu

Looks like there is no easy way to change font/encoding for menu rendering. Maybe it's somewhere in the code files, and you need to change and compile it in order to be able to decode menu in another ...
Vladimir Oprya's user avatar
2 votes

How to zoom to text in VIM via shortcut?

Apparat's answer works for gVim; if you're using Vim from within a Terminal, you will need to configure the terminal to change the font size. For Xterm, I like to use: XTerm*VT100.translations: #...
Martin Tournoij's user avatar
2 votes

Use visual mode to convert text to unicode bold formats?

My TextTransform plugin will handle the setup of a mapping; this will support normal mode command for lines and {motion}, as well as visual mode. Here's an example that only works with A; you need to ...
Ingo Karkat's user avatar
  • 17.8k

Only top scored, non community-wiki answers of a minimum length are eligible