I used set colorcolumn=80 and set the color to red in the python.vim file. Works like a champ - even for all other files.

I'd also like to set colorcolumn=110 for C files though; this one has been set to darkgray for color separation.

It seems the order of loading is the problem; if python.vim loads last, its column and color are used; if clang.vim is loaded last, then it stomps the python.vim.

Turning the dial back, I've been diddling with my own tailored vim setup for quite a while now. I clearly got a little carried away with the modularity; that notwithstanding:

Within the existing context, how would one make this change so it's language specific?


1 Answer 1


the standard way to do this is to create autocommands groups:

augroup python
    au! " clear augroup when reloading vimrc
    autocmd FileType python set colorcolumn=80
augroup END

augroup cc
    au! " clear augroup when reloading vimrc
    autocmd FileType c,cpp set colorcolumn=110
augroup END

is a way to execute specific commands for a given filetype.

But as you want to source specific files given a filetype, then you should use:


to load your personal commands.

  • If you do appreciate my help, you can accept my answer and vote it up ;-) otherwise you're welcome!
    – zmo
    Sep 8, 2015 at 8:04
  • Accepted! I attempted to vote it up but there are restrictions for newbs; gotta get 15 rep before I can vote, sorry man.
    – todd_dsm
    Sep 8, 2015 at 18:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.