On Fri, 28 Apr 2006 14:59:21 -0700 (PDT)
Justin wrote:
>
> if (pExample != NULL)
> {
> // code here
> }
>
> Any ideas as to how I can achieve this?
The general approach is to place the cursor on the if-line (or any other
beginning line) and then use indent(1), the C source format program which
has many options and which defaults to your BSD-like braces.
In your example I would type:
!}indent
or
!4j indent
After !} you will see the bottom-colon-mode line and your input is
readable. The "!" exclamation mark is not visible when you type it.
Funny, ah?
So "Vi" can send any block of text through any Unix filter. That is very
handy in many, many situations. I often use "fmt -65" for better results
than gq} and sometimes sort for unsorted numbered (one-line)lists.
You can also get the output from any command by typing the command within
VIM and then do two exclamation-marks and <return>.
like
date !!<return>
This is the original strength of Unix; commands can be used together,
in pipes or piping from one into another and back-again.
--
dax2-tele2adsl:dk -- http://d-axel.dk/blox/ Donald Axel