You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Scott Stirling <ss...@allaire.com> on 1999/10/21 16:19:20 UTC

VIM [was source code standards!!!!!]

A couple VIM things:

When editing Java, it depends whether you are using the java.vim syntax file
for Java, or whether you have your own syntax.vim for Java, or whether you
set these controls in .vimrc.  It's pretty much totally configurable.
Here's some good stuff:

:set autoindent
This just makes VIM indent however many spaces the previous line was
indented.  Very handy and simple.  This works in VI too.

:set cindent
Turns on awareness to C-style syntax and does some more intelligent
formatting than autoindent, all of which is configurable via parameters to
"set cinoptions."  The default indent when you hit <CR> after a "{" is a tab
equivalent to 8 spaces.

:set expandtab
Automatically expands tabs to spaces.  The default tab is 8 spaces.

:set textwidth=80
This will automatically break lines at 80 characters (or whatever number you
set it equal to).  Strings that continue beyond 80 chars are bumped
automatically to the next line.

Scott Stirling
Allaire Corporation
JRun: http://www.allaire.com/developer/jrunreferencedesk/
Allaire Knowledge Base:
http://www1.allaire.com/Support/KnowledgeBase/SearchForm.cfm

> "vim" to be exact (vi improved).  It probably has the same capability
> buried deep inside it -- and after *this* comment I'm just going to 
> have to dig to find it!  :-)
> 
> Anyone out there have the technique at their fingertips?  My spacebar
> thumb, I admit, is getting tired.

Re: VIM [was source code standards!!!!!]

Posted by Tsoloane Moahloli <ts...@zen.co.za>.
Furthermore I also user the following

set shiftwidth=4
set tabstop=4

This sets the various tab values mentioned below to 4 chars.  I think this
looks much nicer than 8...
----- Original Message -----
From: Scott Stirling <ss...@allaire.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, October 21, 1999 4:19 PM
Subject: VIM [was source code standards!!!!!]


> A couple VIM things:
>
> When editing Java, it depends whether you are using the java.vim syntax
file
> for Java, or whether you have your own syntax.vim for Java, or whether you
> set these controls in .vimrc.  It's pretty much totally configurable.
> Here's some good stuff:
>
> :set autoindent
> This just makes VIM indent however many spaces the previous line was
> indented.  Very handy and simple.  This works in VI too.
>
> :set cindent
> Turns on awareness to C-style syntax and does some more intelligent
> formatting than autoindent, all of which is configurable via parameters to
> "set cinoptions."  The default indent when you hit <CR> after a "{" is a
tab
> equivalent to 8 spaces.
>
> :set expandtab
> Automatically expands tabs to spaces.  The default tab is 8 spaces.
>
> :set textwidth=80
> This will automatically break lines at 80 characters (or whatever number
you
> set it equal to).  Strings that continue beyond 80 chars are bumped
> automatically to the next line.
>
> Scott Stirling
> Allaire Corporation
> JRun: http://www.allaire.com/developer/jrunreferencedesk/
> Allaire Knowledge Base:
> http://www1.allaire.com/Support/KnowledgeBase/SearchForm.cfm
>
> > "vim" to be exact (vi improved).  It probably has the same capability
> > buried deep inside it -- and after *this* comment I'm just going to
> > have to dig to find it!  :-)
> >
> > Anyone out there have the technique at their fingertips?  My spacebar
> > thumb, I admit, is getting tired.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>