Gvim: Ubuntu letter spacing (Consolas font)

后端 未结 2 831
花落未央
花落未央 2021-01-01 13:00

Thought I could just copy my vimrc from my Windows to my Linux box but running into a few problems with the letter spacing on Ubuntu.

相关标签:
2条回答
  • 2021-01-01 13:33

    AFAIK the :h thing only works on Windows and OS X, in Linux it should be

    :set guifont=Consolas\ 11
    

    The weird display is usually caused by wrong font setting. If you are using gvim in different OSs, you can put this to your .gvimrc:

    if has("gui_gtk2")
        set guifont=Consolas\ 11
    elseif has("gui_macvim")
        set guifont=Consolas:h12
    elseif has("gui_win32")
        set guifont=Consolas:h11
    end
    
    0 讨论(0)
  • 2021-01-01 13:47

    I don't know what the :h directive is supposed to do, but

    :set guifont=Consolas:h11
    

    yields horrible intraletter spacing, but

    :set guifont=Consolas\ 11
    

    is fine. (But set guifont=Droid\ Sans\ Mono is better still ;)

    0 讨论(0)
提交回复
热议问题