how to disable bold font in vim?

Viewed 15824

i've removed all references to bold (gui=bold, cterm=bold, term=bold) in the color syntax file slate.vim but i still see some bolded text. for example in a python file, the keywords class, def, try, except, return, etc. are still in a bold blue font.

also how to disable bold in status messages, like "recording" or "Press ENTER or type command.."?

7 Answers

Just in case someone is using iTerm on MacOS and also has this problem (since the same color scheme and vimrc settings under Ubuntu never gave me this problem), there is an option in iTerm under Preference->Profiles->text that stops iTerm from rendering any bold text. That's an easier and quicker fix.

@devskii 's answer in the comment, above, works great for me. I'm going to include specifically the unbolding part here & wiki the answer. (If @devskii would like to make it an answer, I'll delete this... if I can delete wiki answers.)


Put this in your .gvimrc and smoke it:

" 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
    " open temp buffer
    new
    " paste in
    silent! put x

    " convert to vim syntax (from Mkcolorscheme.vim,
    "   http://vim.sourceforge.net/scripts/script.php?script_id=85)
    " delete empty,"links" and "cleared" lines
    silent! g/^$\| links \| cleared/d
    " join any lines wrapped by the highlight command output
    silent! %s/\n \+/ /
    " remove the xxx's
    silent! %s/ xxx / /
    " add highlight commands
    silent! %s/^/highlight /
    " protect spaces in some font names
    silent! %s/font=\(.*\)/font='\1'/

    " substitute bold with "NONE"
    execute 'silent! %s/' . a:attr . '\([\w,]*\)/NONE\1/geI'
    " yank entire buffer
    normal ggVG
    " copy
    silent! normal "xy
    " run
    execute @x

    " remove temp buffer
    bwipeout!

    " restore selection registers
    silent! normal ggVGy
    bwipeout!
endfunction
autocmd BufNewFile,BufRead * call Highlight_remove_attr("bold")
Related