2009-10-08 46 views
3

我正在嘗試爲gvim找到一個最佳字體來在C/C++中編程。什麼是用於C/C++編程的良好gvim guifont

我目前在〜/ .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 [email protected] 
    " 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 
+0

當你關心的是字體時,爲什麼要包含整個.gvimrc? – 2009-10-08 19:17:33

+0

歡迎您編輯您認爲無關的內容。我只留下染色的東西。 – vehomzzz 2009-10-08 19:20:21

+0

你也在問顏色方案嗎,或者只是字體?如果是後者,「set guifont」系列就足夠了。 – 2009-10-08 19:21:58

回答

18

您可以使用:set guifont=*彈出一個字體選擇對話框。一旦你選擇了一個字體使用:echo &guifont看看你的.gvimrc。 (記得\ -escape空格)

就個人而言,我喜歡Inconsolata。從我的.gvimrc裏:

set guifont=Inconsolata\ 13 
+0

+1 @Laurence G. Agh,我沒有Inconsolata。另一個你會推薦的? – vehomzzz 2009-10-08 19:26:09

+0

我也喜歡Andale。你使用的是什麼操作系統/發行版?在Ubuntu上,你可以'apt-get install ttf-inconsolata'。在其他系統上,您可以從http://www.levien.com/type/myfonts/inconsolata.html下載它 – 2009-10-08 19:30:05

+0

您可能還想要對「編程字體」進行一些搜索。這裏有一些很好的列表:http://hivelogic.com/articles/top-10-programming-fonts – 2009-10-08 19:31:49

1

退房monofur - 這是相當不尋常的等寬字體。除此之外,我使用摩納哥。

0

我喜歡宋體,其良好的..

我的.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 
1

有幾個可能性here比較不錯。

我曾經使用ProggyCleanSZ(斜線爲零的版本),這是一種位圖字體,在12號尺寸上看起來真的不錯(儘管尺寸與9-10字體的尺寸大小差不多)。雖然易於辨認,但易於區分0O以及1,Il。我從此轉向使用Envy Code R

+0

Brokne鏈接,請考慮更新此答案或刪除它。 – 2015-03-24 09:07:47

+0

@FabrizioRegini - 感謝您的舉報:我已修復此鏈接。 – DrAl 2015-03-24 12:42:06

相關問題