[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: using settings for certain files only
From:       Jürgen_Krämer <jkr () jottkaerr ! de>
Date:       2003-10-04 11:12:34
[Download RAW message or body]


Hi,

christopher j bottaro wrote:
> ok, here's what my .vimrc file looks like now:
> 
> [cjb@semaphore puzzler2]$ cat ~/.vimrc
> set syntax=enable

with this line you tell VIM to use the syntax of the 'enable' language.
Unless there really is such a language you probably wanted to say

  syntax on

> set background=dark
> set number
> set tabstop=4
> set nohls
> set ic
> autocmd!
> autocmd BufNewFile,BufRead *.cpp,*.h,*.c,*.c++ set cindent shiftwidth=4

Here you setup your own kind of filetype detection scheme. You can take
advantage of VIM's one by replacing the last two lines with

  filetype on

In the case of C and C++ files this would source the default filetype
plugins, which already set cindent. To set the shiftwidth option to 4
you then would create (or supplement) your own filetype plugins,
~/.vim/after/ftplugin/c.vim and .../cpp.vim, respectively, with the line

  :set shiftwidth=4

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic