From: Paul M Foster on
On Tue, Apr 27, 2010 at 08:52:09PM -0500, Programming Guides wrote:

> On Tue, Apr 27, 2010 at 6:00 PM, D. Dante Lorenso <dante(a)lorenso.com> wrote:
>
> > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> >
> >> On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> >>
> >>> Hi everyone.
> >>> I got a quickie LOL
> >>> is there a way to auto indent code. I'm using Kate and I have it set so
> >>> the
> >>> tab is only 4 spaces, but I was wondering if there was an easier way than
> >>> to
> >>> have to hit the tab key 1x then 2x then 3x then 2x then 1x to create nice
> >>> laid
> >>> out code like this:
> >>>
> >>

<snip>

> vim ftw:
>
> 1. select the piece of code you want to indent (or select all with "ggVG")
> 2. Hit =
> 3. profit!

+1 for vim

I use a limited number of "g" commands, like gg, G and gwap, but I use
them rotely; I've never understood the variations. Can you point me to
some sort of tutorial on these?

Paul


--
Paul M. Foster
From: David McGlone on
On Tuesday 27 April 2010 16:55:45 Ashley Sheridan wrote:
> On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > Hi everyone.
> >
> > I got a quickie LOL
> >
> > is there a way to auto indent code. I'm using Kate and I have it set so
> > the tab is only 4 spaces, but I was wondering if there was an easier way
> > than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> > create nice laid out code like this:
> >
> > -----
> > -----
> > -----
> > -----
> > -----
> > -----
> > -----
> > -----
> > -----
> >
> > or:
> >
> > function() {
> >
> > function here
> > }
>
> I use Kate too, and the indentation changed slightly in KDE 4. In the
> configure dialogue window, go down to the Editing section in the left
> menu and set the number of spaces to use in both the General tab (under
> Tabulators) and the Indentation tab (under Indentation Properties. If
> they are both different then you have to hit the tab key 4 times in
> order for your spaces to be replaced by a tab character.

Thanks Ash. What is your preferences for indenting code? Do you have it set
so you don't have to hit the tab key at all? I set my numbers in kate to 4
what about you?

--
Blessings,
David M.
From: David McGlone on
On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
> On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> >> Hi everyone.
> >> I got a quickie LOL
> >> is there a way to auto indent code. I'm using Kate and I have it set so
> >> the tab is only 4 spaces, but I was wondering if there was an easier way
> >> than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> >> create nice laid out code like this:
>
> I use PHPEclipse for this. It's not Eclipse with PDT, it's PHP Eclipse:
>
> http://www.phpeclipse.com/
>
> The code formatter built into that formats my code when I hit
> Ctrl+Shift+F. No other code formatter works as well for what I've
> found. Many formatters just indent, this one will reformatt by putting
> brackets up or down, and reindent all the code to fit my coding standards.
>
> Project is getting a little old, though and doesn't yet support PHP 5.3
> syntax, but it's still the best I've found.

I haven't tried this one. I am just so stuck on Kate. I've tried a ton of
editors and Kate is simply the best one for me hands down.

I'll check out php Eclipse. Never know I may be impressed with it.

After about 10 or more years of using KDE, I am have been running Gnome for
about a year now, but I always always install Kontact and kate.

--
Blessings,
David M.
From: Programming Guides on
On Tue, Apr 27, 2010 at 9:15 PM, Paul M Foster <paulf(a)quillandmouse.com>wrote:

> On Tue, Apr 27, 2010 at 08:52:09PM -0500, Programming Guides wrote:
>
> > On Tue, Apr 27, 2010 at 6:00 PM, D. Dante Lorenso <dante(a)lorenso.com>
> wrote:
> >
> > > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > >
> > >> On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > >>
> > >>> Hi everyone.
> > >>> I got a quickie LOL
> > >>> is there a way to auto indent code. I'm using Kate and I have it set
> so
> > >>> the
> > >>> tab is only 4 spaces, but I was wondering if there was an easier way
> than
> > >>> to
> > >>> have to hit the tab key 1x then 2x then 3x then 2x then 1x to create
> nice
> > >>> laid
> > >>> out code like this:
> > >>>
> > >>
>
> <snip>
>
> > vim ftw:
> >
> > 1. select the piece of code you want to indent (or select all with
> "ggVG")
> > 2. Hit =
> > 3. profit!
>
> +1 for vim
>
> I use a limited number of "g" commands, like gg, G and gwap, but I use
> them rotely; I've never understood the variations. Can you point me to
> some sort of tutorial on these?
>
> Paul
>
>
> --
> Paul M. Foster
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I gotta say I dont understand the "g" commands very well either. They dont
seem to have much in common, and I, like yourself know a handful that I am
comfortable using. In any case, this cheat sheet has several "g" commands
(although I commonly use some that are not listed):

http://www.fprintf.net/vimCheatSheet.html

--
Viktor
http://programming-guides.com
From: Paul M Foster on
On Tue, Apr 27, 2010 at 10:29:33PM -0400, David McGlone wrote:

> On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
> > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > > On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > >> Hi everyone.
> > >> I got a quickie LOL
> > >> is there a way to auto indent code. I'm using Kate and I have it set so
> > >> the tab is only 4 spaces, but I was wondering if there was an easier way
> > >> than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> > >> create nice laid out code like this:
> >
> > I use PHPEclipse for this. It's not Eclipse with PDT, it's PHP Eclipse:
> >
> > http://www.phpeclipse.com/
> >
> > The code formatter built into that formats my code when I hit
> > Ctrl+Shift+F. No other code formatter works as well for what I've
> > found. Many formatters just indent, this one will reformatt by putting
> > brackets up or down, and reindent all the code to fit my coding standards.
> >
> > Project is getting a little old, though and doesn't yet support PHP 5.3
> > syntax, but it's still the best I've found.
>
> I haven't tried this one. I am just so stuck on Kate. I've tried a ton of
> editors and Kate is simply the best one for me hands down.

I have to say, back in the day when I used a GUI editor, Kate was the
best I found.

Paul

--
Paul M. Foster