what is the good gvim guifont for C/C++ programming [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
开发者_如何转开发 Improve this questionI am trying to find an optimal font for gvim to program in C/C++.
I currently have the following in ~/.gvimrc and I don't like it:
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
You can use :set guifont=*
to bring up a font chooser dialog. Once you've chosen a font use :echo &guifont
to see what to put in your .gvimrc. (remember to \
-escape spaces)
Personally, I like Inconsolata. From my .gvimrc:
set guifont=Inconsolata\ 13
Is it possible to use Consolas font there? It is the best monosize font I've ever seen.
Ok, it is possible. Check screenshot below:
image http://img.flashtux.org/upload/img132432527b55x895f9d81.png
Check out monofur - it's quite an unusual monospaced font. Other than that, I use Monaco.
There's a good comparison of a few possibilities here.
I used to use ProggyCleanSZ (the slashed-zero version), which is a bitmap font that only really looks any good in size 12 (although it's about the same size as a size 9-10 font). Very easy on the eyes though and easy to differentiate between 0
and O
as well as 1
, I
and l
. I have since switched to using Envy Code R.
I prefer Courier New, its good..
my .vimrc includes this code snippet to change the font
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
精彩评论