carugnom, Fri 2012-01-13 @ 10:45:55-0800: > Does somebody have a vim configuration example, where separated > configuration files by each language (c, python, etc) can be used. So > when i open a .c source, configuration for c files is applied, when i > open a .py source, configuration for python files is applied, and so > on
This is called an "ftplugin" (file type plugin). Just write a script,
and name it <filetype>.vim, where <filetype> is the name of the file
type you want it to apply to ("c" for C source files, "python" for
Python, etc.). Then put it in your ~/.vim/ftplugin directory and it
should take effect the next time you load a buffer with that filetype.
If you want more than one script to execute for a given filetype, there
is an alternate method: Rather than naming the script <filetype>.vim and
putting it in ~/.vim/ftplugin, you can instead create a directory called
~/.vim/ftplugin/<filetype> and place any number of scripts in that
directory. They will all be sourced when loading a buffer of that type.
pgpboO3RdNyVO.pgp
Description: PGP signature
