What is a good gvim guifont for programming in C / C ++?

I am trying to find the optimal font for gvim for programming in C / C ++.

I currently have ~ / .gvimrc and I don't like this:

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
+3
source share
5 answers

You can use :set guifont=*to open the font selection dialog. Once you have selected a font, use :echo &guifontto find out what to put in your .gvimrc. (don't forget \-safe spaces)

Personally, I like Inconsolata. From my .gvimrc:

set guifont=Inconsolata\ 13
+18
source

Can I use Consolas Font? This is the best monosize font I've ever seen.

, . :

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

+5

monofur - . , .

+1

.

ProggyCleanSZ ( ), , 12 ( , 9-10). 0 O, 1, I l. Envy Code R.

+1

Courier New, ..

my.vimrc includes this code snippet for changing 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   
0
source

Source: https://habr.com/ru/post/1719652/


All Articles