什么是C / C ++编程的优秀gvim guifont

时间:2009-10-08 19:13:09

标签: c++ c vim

我正在尝试找到gvim在C / C ++中编程的最佳字体。

我目前在〜/ .gvimrc中有以下内容,我不喜欢它:

if has("gui_gtk2")
    set guifont=MiscFixed\ 11
else
    set guifont=-misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
endif
set columns=80 lines=50
set guioptions-=T "hide toolbar

"Try to load happy hacking teal colour scheme
"I copy this to ~/.vim/colors/hhteal.vim
silent! colorscheme hhteal
if exists("colors_name") == 0
    "Otherwise modify the defaults appropriately

    "background set to dark in .vimrc
    "So pick appropriate defaults.
    hi Normal     guifg=gray guibg=black
    hi Visual     gui=none guifg=black guibg=yellow

    "The following removes bold from all highlighting
    "as this is usually rendered badly for me. Note this
    "is not done in .vimrc because bold usually makes
    "the colour brighter on terminals and most terminals
    "allow one to keep the new colour while turning off
    "the actual bolding.

    " Steve Hall wrote this function for me on vim@vim.org
    " See :help attr-list for possible attrs to pass
    function! Highlight_remove_attr(attr)
        " save selection registers
        new
        silent! put

        " get current highlight configuration
        redir @x
        silent! highlight
        redir END

5 个答案:

答案 0 :(得分:20)

您可以使用:set guifont=*打开字体选择器对话框。选择字体后,请使用:echo &guifont查看要放入.gvimrc的内容。 (记得\ - 逃避空间)

就个人而言,我喜欢Inconsolata。来自我的.gvimrc:

set guifont=Inconsolata\ 13

答案 1 :(得分:5)

可以在那里使用Consolas字体吗?这是我见过的最好的monosize字体。

好的,有可能。查看下面的截图:

image http://img.flashtux.org/upload/img132432527b55x895f9d81.png

答案 2 :(得分:1)

查看monofur - 这是一种非常不寻常的等宽字体。除此之外,我使用摩纳哥。

答案 3 :(得分:1)

对一些可能性here进行了很好的比较。

我曾经使用过ProggyCleanSZ(版本为零的版本),这是一个位图字体,在12号尺寸上看起来确实不错(尽管它与9-10字体的大小大致相同)。虽然很容易区分0O以及1Il。我已经切换到使用Envy Code R

答案 4 :(得分:0)

我更喜欢Courier New,它的优点......

我的.vimrc包含此代码段来更改字体

if has("gui_running")  
    if has("gui_gtk2")  
        set guifont=Courier\ New\ 10  
    elseif has("x11")  
        set guifont=-*-courier-medium-r-normal-*-*-180-*-*-m-*-*  
    else  
        set guifont=Courier_New:h10:cDEFAULT  
    endif  
endif   
相关问题