On Sat, Jul 20, 2002 at 09:22:08AM +1000, mdevin wrote: > On Fri, Jul 19, 2002 at 19:43:08 +0200, Matijs van Zuijlen wrote: > > On Fri, Jul 19, 2002 at 10:51:20AM +1000, mdevin wrote: > > > Can people make some suggestions on vimrc entries for programming, > > > syntax highlighting, automatic indenting etc. My current entries work > > > OK for C, C++, Java etc. but not perl. I guess I only need to add the > > > .pl and .cgi extensions to the autocommand sections to get this to work. > > > However, I am interested in what others use. Particularly, there is > > > some autodetection ability I think, so that if I don't give the files > > > .pl or .cgi extensions, it still performs OK. > > > > > > I have the following entries in my vimrc for programming stuff: > > > [ snip ] > > > > > > Suggestions welcome. > > > > How you tried how things work without the autocommands? I only have > > indent and tabstop settings and such in my .vimrc, and gvim recognizes > > perl with and without the .pl extension out-of-the-box (I would guess it > > uses the #! line for detection). I just tested with vim, and putting > > > I am finding it very hard going understanding how the autocmnd stuff > works. From what I could figure, it seems as though the autocmnd things > are based on the file extensions. Yet I know that vim recognises a perl > file regardless of what its extension is. How do you tell vim to do the > indenting based on the auto recognition? > > Mate! setting up your .vimrc is more complex than writing a whole c, > perl, or java program yourself. > > I was hoping that some of the guru programmers on this list could post > their vimrc files so I could get some ideas - particularly with > reference to perl, java, and C/C++ programming. > > If anyone has their vimrc set up well for programming, please post some > suggestions, as I am flailing here. What I meant to say was: Debian's default vimrc (in /etc/vim/vimrc, AFAICS) is already set up very well for programming (including perl), at least in Woody (You _are_ using Debian, aren't you?). All I have in my ~/.vimrc is: version 6.0 set nocompatible map ,g ,f,e map ,f :files map ,e :e# set autoindent set backspace=2 set hidden set hlsearch set report=0 set ruler set shiftwidth=4 set smarttab set softtabstop=4 set viminfo='50, set visualbell set textwidth=75 set nowrap syntax on -- Note that I use Debian version 3.0 Linux mus 2.4.17mvz5 #1 Sun Jun 2 15:16:44 CEST 2002 i686 unknown Matijs van Zuijlen ... designed to fill holes or cracks of not more than two cubic vims. -- Robert Sheckley, Untouched by Human Hands
Attachment:
pgpK5ABLCGPN5.pgp
Description: PGP signature